Skip to content

bpo-29854: Skip history-size test on older readline#2621

Merged
berkerpeksag merged 1 commit into
python:masterfrom
nirs:readline-segfault
Jul 8, 2017
Merged

bpo-29854: Skip history-size test on older readline#2621
berkerpeksag merged 1 commit into
python:masterfrom
nirs:readline-segfault

Conversation

@nirs

@nirs nirs commented Jul 7, 2017

Copy link
Copy Markdown
Contributor

Turns out that history-size was added in readline 6.0. This explain why
this tests fail on FreeBSd and OS X using readline version 5.2 and 5.1.
Skipping the test now based on readline version instead of libedit
emulation.

See https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES.

@berkerpeksag, @Haypo, @vadmium please review.

@mention-bot

Copy link
Copy Markdown

@nirs, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vadmium, @ronaldoussoren and @benjaminp to be potential reviewers.

@nirs

nirs commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

Warning: untested yet.

Comment thread Lib/test/test_readline.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need to skip the test if editline is available since it uses a different configuration format than readline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, we have several reasons for skiping:

  • libedit on os x 10.11.6 does not implement history size - I tested using the libedit special format.
  • newer version on os x not tested yet, I don't want to add a possibly broken test
  • readline < 6.0 does not support history size

Comment thread Lib/test/test_readline.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been using _READLINE_VERSION without a fallback value in test_init in line 116 for a while and I don't remember any issue reported on bugs.p.o because of it. I think we can safely drop the fallback value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should fix the old code not to assume private attributes, same as @Haypo patch for printing readline version.

For this patch I'll drop the fallback.

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.
@nirs nirs force-pushed the readline-segfault branch from 97c8933 to 50d8465 Compare July 7, 2017 22:56
@nirs

nirs commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

Version 2 addresses @berkerpeksag comments.

Tested on Fedora 25 (ok), FreeBSD 11 (ok), OS X 10.11.6 (skipped)

@berkerpeksag berkerpeksag merged commit aa6a4d6 into python:master Jul 8, 2017
@berkerpeksag

Copy link
Copy Markdown
Member

Thanks!

@nirs nirs deleted the readline-segfault branch July 8, 2017 14:47
nirs added a commit to nirs/cpython that referenced this pull request Jul 8, 2017
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.
nirs added a commit to nirs/cpython that referenced this pull request Jul 8, 2017
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.
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.

4 participants