GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-29854: test_readline logs versions in verbose mode by vstinner · Pull Request #2619 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Jul 7, 2017

Copy link
Copy Markdown
Member

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner requested a review from berkerpeksag July 7, 2017 12:46
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jul 7, 2017
@vstinner vstinner mentioned this pull request Jul 7, 2017
bpo-29854: Print readline version information when running test suite #2618
Closed
@vstinner

vstinner commented Jul 7, 2017

Copy link
Copy Markdown
Member Author

See also @berkerpeksag PR which logs readline version in the regrtest header: PR #2618.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nirs
nirs reviewed Jul 7, 2017
View reviewed changes
Comment thread Lib/test/test_readline.py Outdated

@nirs nirs Jul 7, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We add these with:

PyModule_AddIntConstant(m, "_READLINE_VERSION", RL_READLINE_VERSION);

So maybe we don't need the hasattr check?

Also, we need to know this is libedit, and looking at the tests, we need:

is_editline = readline.__doc__ and "libedit" in readline.__doc__

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Jul 7, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

So maybe we don't need the hasattr check?

I like the idea of using test_readline unchanged on Python implementations other than CPython. Tests cannot rely on private attributes in tests, not without @cpython_only or hasattr(). I added a comment to explain the rationale.

is_editline

Right, I also logged this flag, even if the other attributes are not available.

I chose to also expose rl_library_version as a private attribute to be able to log it in test_readline. It may help to debug subtle differences between two readline versions, and validate manually is_editline flag.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nirs
nirs reviewed Jul 7, 2017
View reviewed changes
Comment thread Lib/test/test_readline.py Outdated

@nirs nirs Jul 7, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@berkerpeksag version showing "readline implementation: libedit|GNU readline" can be little nicer.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Jul 7, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I changed that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/readline.c Outdated

@nirs nirs Jul 7, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why not uppercase like the other constants?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Jul 7, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Oh, I didn't notice that the variable on the previous line is in lower case but exported as UPPER case. I converted my new constant to UPPER case and rename "rl" to READLINE, as done for the 2nd constant.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
bpo-29854: test_readline logs versions
670c4c2
* test_readline logs the versions of libreadline when run in verbose
  mode
* Add also readline._READLINE_LIBRARY_VERSION
nirs
nirs approved these changes Jul 7, 2017
View reviewed changes
Comment thread Lib/test/test_readline.py
if hasattr(readline, "_READLINE_LIBRARY_VERSION"):
is_editline = ("EditLine wrapper" in readline._READLINE_LIBRARY_VERSION)
else:
is_editline = (readline.__doc__ and "libedit" in readline.__doc__)

@nirs nirs Jul 7, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't like duplicating the horrible doc check, and adding a new incompatible check for the same thing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Jul 7, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't like duplicating the horrible doc check, and adding a new incompatible check for the same thing.

IMHO such enhancement would deserves its own PR ;-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner merged commit 1881bef into python:master Jul 7, 2017
@vstinner
vstinner deleted the test_readline_version branch July 7, 2017 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
1 more reviewer
@nirs nirs nirs approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @nirs @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.