You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Export Readline version and expect ANSI sequence for version < 0x0600 #66962
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:
assignee=Noneclosed_at=<Date2014-11-04.14:14:52.336>created_at=<Date2014-10-31.14:01:28.065>labels= ['extension-modules', 'type-bug']
title='Export Readline version and expect ANSI sequence for version < 0x0600'updated_at=<Date2014-11-04.14:14:52.335>user='https://bugs.python.org/DavidEdelsohn'
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?
DavidEdelsohn commented on Oct 31, 2014
DavidEdelsohnmannequin
MannequinAuthor
More actions
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.
Naming it _READLINE_BUILDTIME_VERSION instead of _READLINE_VERSION would avoid ambiguity.
DavidEdelsohn commented on Oct 31, 2014
DavidEdelsohnmannequin
MannequinAuthor
More actions
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.
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.'
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.
DavidEdelsohn commented on Oct 31, 2014
DavidEdelsohnmannequin
MannequinAuthor
More actions
@ned.deily Can you offer a suggestion of how you you like the skipIf test modified to check __doc__ for "libedit"?
changed the title [-]Export Readline version and expect ANSI sequence for version < 0x6000[/-][+]Export Readline version and expect ANSI sequence for version < 0x0600[/+]on Nov 1, 2014
Activity
DavidEdelsohn commentedon Oct 31, 2014
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.
DavidEdelsohn commentedon Oct 31, 2014
Patch attached to export version and skip test if version less than 0x600.
DavidEdelsohn commentedon Oct 31, 2014
Revised patch with leading underscores to make version objects private.
vstinner commentedon Oct 31, 2014
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?
DavidEdelsohn commentedon Oct 31, 2014
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.
pitrou commentedon Oct 31, 2014
+1 for the patch.
Arfrever commentedon Oct 31, 2014
Naming it _READLINE_BUILDTIME_VERSION instead of _READLINE_VERSION would avoid ambiguity.
DavidEdelsohn commentedon Oct 31, 2014
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.
pitrou commentedon Oct 31, 2014
Indeed, I think there's no ambiguity here. Victor, are you ok with the patch?
ned-deily commentedon Oct 31, 2014
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 1026The 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.'ned-deily commentedon Oct 31, 2014
Make that: The documented way of differentiating the two cases is by checking the __doc__ string for "libedit".
vstinner commentedon Oct 31, 2014
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.
DavidEdelsohn commentedon Oct 31, 2014
@ned.deily Can you offer a suggestion of how you you like the skipIf test modified to check __doc__ for "libedit"?
ned-deily commentedon Oct 31, 2014
Something like:
should work.
DavidEdelsohn commentedon Oct 31, 2014
Okay, grouping was wrong in my initial attempt. New patch attached.
ned-deily commentedon Oct 31, 2014
The test works OK with libedit now, thanks. But are you sure about the readline version test? Testing with a GNU readline 6.3:
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?
DavidEdelsohn commentedon Oct 31, 2014
The test should be 0x0600.
[-]Export Readline version and expect ANSI sequence for version < 0x6000[/-][+]Export Readline version and expect ANSI sequence for version < 0x0600[/+]python-dev commentedon Nov 4, 2014
New changeset c4b5a5d44254 by Antoine Pitrou in branch '3.4':
Issue bpo-22773: fix failing test with old readline versions due to issue bpo-19884.
https://hg.python.org/cpython/rev/c4b5a5d44254
New changeset be374b8c40c8 by Antoine Pitrou in branch 'default':
Issue bpo-22773: fix failing test with old readline versions due to issue bpo-19884.
https://hg.python.org/cpython/rev/be374b8c40c8
python-dev commentedon Nov 4, 2014
New changeset eba6e68e818c by Antoine Pitrou in branch '2.7':
Issue bpo-22773: fix failing test with old readline versions due to issue bpo-19884.
https://hg.python.org/cpython/rev/eba6e68e818c