New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export Readline version and expect ANSI sequence for version < 0x0600 #66962
Comments
The patch for bpo-19884 to set enable-meta-key to "off" does not work when readline-devel package is libreadline5, which includes SLES 11. |
Patch attached to export version and skip test if version less than 0x600. |
Revised patch with leading underscores to make version objects private. |
I would prefer to see the bug fixed instead of being skipped :-/ Is there a way to fix the issue, but differently on readline < 6.0? |
The portion of the patch to skip the test is necessary because, as mentioned in bpo-19884, setting enable-meta-key does not work in older releases of libreadline. The particular combination of default TERM and libreadline is rare in old OS versions and can be worked around by setting TERM=dummy. |
+1 for the patch. |
Naming it _READLINE_BUILDTIME_VERSION instead of _READLINE_VERSION would avoid ambiguity. |
I am trying to follow the precedent of zlibmodule with the naming so that users of Python modules have as consistent an experience and user interface as possible. |
Indeed, I think there's no ambiguity here. Victor, are you ok with the patch? |
The patch doesn't take into account that the readline module may be linked with BSD libedit (as is the default on OS X and is preferred by some third-party distributors) rather than GNU readline. The patch causes the test to be incorrectly skipped on those platforms. >>> readline._READLINE_VERSION
1026 The documented way of differentiating the two cases is by checking the __doc__ string for "readline" or "libedit": >>> readline.__doc__
'Importing this module enables command line editing using libedit readline.' vs. >>> readline.__doc__
'Importing this module enables command line editing using GNU readline.' |
Make that: The documented way of differentiating the two cases is by checking the __doc__ string for "libedit". |
In the past, I added sys.thread_info to be able to skip tests on some old platforms. Maybe we need something similar: an object with runtime version, build version, implementation name, etc. |
@ned.deily Can you offer a suggestion of how you you like the skipIf test modified to check __doc__ for "libedit"? |
Something like:
should work. |
Okay, grouping was wrong in my initial attempt. New patch attached. |
The test works OK with libedit now, thanks. But are you sure about the readline version test? Testing with a GNU readline 6.3: >>> print('%x' % readline._READLINE_RUNTIME_VERSION)
603 so the test_readline check: readline._READLINE_VERSION < 0x6000 causes the test to be incorrectly skipped. What does _READLINE_RUNTIME_VERSION look like for an older version of readline? |
The test should be 0x0600. |
New changeset c4b5a5d44254 by Antoine Pitrou in branch '3.4': New changeset be374b8c40c8 by Antoine Pitrou in branch 'default': |
New changeset eba6e68e818c by Antoine Pitrou in branch '2.7': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: