Staging
v0.5.1
https://github.com/python/cpython
Revision bfa4fe4f39dd8b5ce1a0b649cedd36857859081a authored by Nir Soffer on 10 July 2017, 21:06:57 UTC, committed by Berker Peksag on 10 July 2017, 21:06:57 UTC
If history-length is set in .inputrc, and the history file is double the
history size (or more), history_get(N) returns NULL, and python
segfaults. Fix that by checking for NULL return value.

It seems that the root cause is incorrect handling of bigger history in
readline, but Python should not segfault even if readline returns
unexpected value.

This issue affects only GNU readline. When using libedit emulation
system history size option does not work.

This is a backport of the actual fix from master without the test, since
the test depends on new run_pty() helper which is not available in 2.7.
1 parent 5d1554a
Raw File
Tip revision: bfa4fe4f39dd8b5ce1a0b649cedd36857859081a authored by Nir Soffer on 10 July 2017, 21:06:57 UTC
[2.7] bpo-29854: Fix segfault in call_readline() (GH-728)
Tip revision: bfa4fe4
.hgeol
[patterns]

# Non human-editable files are binary

**.dsp  = BIN
**.dsw  = BIN
**.mk   = BIN
**.sln  = BIN
**.vcproj  = BIN
**.vsprops = BIN

**.aif  = BIN
**.aifc = BIN
**.aiff = BIN
**.au   = BIN
**.bmp  = BIN
**.blob = BIN
**.db   = BIN
**.exe  = BIN
**.icns = BIN
**.gif  = BIN
**.ico  = BIN
**.info = BIN
**.jpg  = BIN
**.pck  = BIN
**.png  = BIN
**.psd  = BIN
**.tar  = BIN
**.wav  = BIN
**.whl  = BIN
**.xar  = BIN
**.zip  = BIN

Lib/email/test/data/msg_26.txt = BIN
Lib/test/cjkencodings/* = BIN
Lib/test/decimaltestdata/*.decTest = BIN
Lib/test/sndhdrdata/sndhdr.* = BIN

# Windows only zlib upstream file
Modules/zlib/zlib.map = CRLF

# Windows batch files work best with CRLF, there can be subtle problems with LF
**.bat = CRLF

# The Windows readme is likely to be read in Notepad, so make it readable
PCbuild/readme.txt = CRLF
PC/VS9.0/readme.txt = CRLF

# All other files (which presumably are human-editable) are "native".
# This must be the last rule!

** = native

[repository]
native = LF
back to top