Skip to content

[3.5] bpo-29854: Backport to 3.5#2636

Merged
berkerpeksag merged 2 commits into
python:3.5from
nirs:bpo-29854-3.5
Jul 9, 2017
Merged

[3.5] bpo-29854: Backport to 3.5#2636
berkerpeksag merged 2 commits into
python:3.5from
nirs:bpo-29854-3.5

Conversation

@nirs
Copy link
Copy Markdown
Contributor

@nirs nirs commented Jul 8, 2017

Tested on Fedora 25, FreeBSD 10.3, FreeBSD 11.0, OS X 10.11.6.

@berkerpeksag, @Haypo please review.

nirs added 2 commits July 9, 2017 00:07
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.
Turns out that history-size was added in readline 6.0. This explain why
this tests fail on FreeBSD when using readline 5.2. We skip now the
history size if readline does not support it.

See https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES for
details.
@berkerpeksag berkerpeksag merged commit 68c3724 into python:3.5 Jul 9, 2017
@nirs nirs deleted the bpo-29854-3.5 branch October 1, 2022 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants