GeezerVison is showing github.com — Python limited history test fails when configured to use editline instead of readline · Issue #123018 · python/cpython
Python limited history test fails when configured to use editline instead of readline #123018DescriptionBug report
Bug description:
While testing python3 ptests (i.e. those contained in Lib/test/) in Yocto for 3.12.5, it was noted that test_write_read_limited_history() fails if Python was configured to use libedit/editline (default) instead of readline.
With readline they pass, but due to licensing differences the former is preferred for default use. Ideally, the tests should not fail in this condition, and at minimum should be skipped (if not able to make both cases pass). We'll disable this test for now but would like to enable this test in the future if possible.
See also: #121160
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
Reacted by Bartosz Sławecki and Gregory P. Smith Activitychanged the title [-]Python tests fail when configured to use editline instead of readline[/-] [+]Python limited history test fails when configured to use editline instead of readline[/+] on Aug 14, 2024sobolevn commented on Aug 15, 2024 I cannot reproduce on macos with editline:
» ./python.exe -m test test_readline -v
== CPython 3.12.5 (tags/v3.12.5:ff3bc82f7c9, Aug 15 2024, 14:46:00) [Clang 15.0.0 (clang-1500.3.9.4)]
== macOS-14.5-arm64-arm-64bit little-endian
== Python build: debug
== cwd: /Users/sobolev/Desktop/cpython2/build/test_python_worker_9169æ
== CPU count: 12
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests
Using random seed: 3936185765
0:00:00 load avg: 4.20 Run 1 test sequentially
0:00:00 load avg: 4.20 [1/1] test_readline
readline version: 0x402
readline runtime version: 0x402
readline library version: 'EditLine wrapper'
use libedit emulation? True
testHistoryUpdates (test.test_readline.TestHistoryManipulation.testHistoryUpdates) ... ok
test_nonascii_history (test.test_readline.TestHistoryManipulation.test_nonascii_history) ... ok
test_write_read_append (test.test_readline.TestHistoryManipulation.test_write_read_append) ... skipped 'append_history not available'
test_write_read_limited_history (test.test_readline.TestHistoryManipulation.test_write_read_limited_history) ... ok
test_auto_history_disabled (test.test_readline.TestReadline.test_auto_history_disabled) ... ok
test_auto_history_enabled (test.test_readline.TestReadline.test_auto_history_enabled) ... ok
test_history_size (test.test_readline.TestReadline.test_history_size) ... skipped 'this readline version does not support history-size'
test_init (test.test_readline.TestReadline.test_init) ... ok
test_nonascii (test.test_readline.TestReadline.test_nonascii) ... ok
test_set_complete_delims (test.test_readline.TestReadline.test_set_complete_delims) ... ok
test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history) ... ok
----------------------------------------------------------------------
Ran 11 tests in 0.089s
OK (skipped=2)
== Tests result: SUCCESS ==
1 test OK.
Total duration: 136 ms
Total tests: run=11 skipped=2
Total test files: run=1/1
Result: SUCCESS
threexc commented on Aug 15, 2024 python3_configure.txt
This is the configure log from my latest test build, if that's helpful. There's a lot of build path info there that might be tricky to parse. Not sure if there's anything obvious in there? threexc commented on Aug 15, 2024 Failure log:
PASS: test_write_read_append (test.test_readline.TestHistoryManipulation.test_write_read_append)
FAIL: test_write_read_limited_history (test.test_readline.TestHistoryManipulation.test_write_read_limited_history)
PASS: test_auto_history_disabled (test.test_readline.TestReadline.test_auto_history_disabled)
PASS: test_auto_history_enabled (test.test_readline.TestReadline.test_auto_history_enabled)
SKIP: test_history_size (test.test_readline.TestReadline.test_history_size) 'this readline version does not support history-size'
PASS: test_init (test.test_readline.TestReadline.test_init)
SKIP: test_nonascii (test.test_readline.TestReadline.test_nonascii) "the LC_CTYPE locale is 'C'"
PASS: test_set_complete_delims (test.test_readline.TestReadline.test_set_complete_delims)
FAIL: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)
======================================================================
ERROR: test_write_read_limited_history (test.test_readline.TestHistoryManipulation.test_write_read_limited_history)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/test/test_readline.py", line 153, in test_write_read_limited_history
readline.read_history_file(TESTFN)
OSError: [Errno 22] Invalid argument
======================================================================
ERROR: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/test/test_readline.py", line 362, in test_write_read_limited_history
readline.read_history_file(TESTFN)
OSError: [Errno 22] Invalid argument
rossburton commented on Sep 12, 2024 FYI, we've replicated this failure with Python 3.12.6. pepoluan commented on Oct 29, 2024 This also happens with the dev-lang/python-3.13.0 package on Gentoo:
test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history) ... ERROR
======================================================================
ERROR: test_write_read_limited_history (test.test_readline.TestHistoryManipulation.test_write_read_limited_history)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/portage/dev-lang/python-3.13.0/work/Python-3.13.0/Lib/test/test_readline.py", line 154, in test_write_read_limited_history
readline.read_history_file(TESTFN)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
OSError: [Errno 22] Invalid argument
======================================================================
ERROR: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/portage/dev-lang/python-3.13.0/work/Python-3.13.0/Lib/test/test_readline.py", line 390, in test_write_read_limited_history
readline.read_history_file(TESTFN)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
OSError: [Errno 22] Invalid argument
----------------------------------------------------------------------
Ran 13 tests in 0.785s
FAILED (errors=2, skipped=3)
test test_readline failed
USE flags:
USE="ensurepip gdbm libedit ncurses pgo readline sqlite ssl -bluetooth -build -debug -examples (-jit) -test -tk -valgrind -ve
rify-sig"
which resulted in the following ./configure invocation:
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --docdir
=/usr/share/doc/python-3.13.0 --htmldir=/usr/share/doc/python-3.13.0/html --libdir=/usr/lib64 ac_cv_header_stropts_h=no --enable-shared --without-static-libpython --enable-ipv6 --infodir=${prefix}/share/info --mandir=${prefix}/s
hare/man --with-computed-gotos --with-dbmliborder=gdbm --with-libc= --enable-loadable-sqlite-extensions --without-ensurepip --without-lto --with-system-expat --with-system-libmpdec --with-platlibdir=lib --with-pkg-config=yes --w
ith-wheel-pkg-dir=/usr/lib/python/ensurepip --enable-gil --without-assertions --disable-experimental-jit --enable-optimizations --with-readline=editline --without-valgrind --with-lto
Edited to Add:
Specifying -libedit for the USE flag resulted in a different ./configure invocation:
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --docdir
=/usr/share/doc/python-3.13.0 --htmldir=/usr/share/doc/python-3.13.0/html --libdir=/usr/lib64 ac_cv_header_stropts_h=no --enable-shared --without-static-libpython --enable-ipv6 --infodir=${prefix}/share/info --mandir=${prefix}/s
hare/man --with-computed-gotos --with-dbmliborder=gdbm --with-libc= --enable-loadable-sqlite-extensions --without-ensurepip --without-lto --with-system-expat --with-system-libmpdec --with-platlibdir=lib --with-pkg-config=yes --w
ith-wheel-pkg-dir=/usr/lib/python/ensurepip --enable-gil --without-assertions --disable-experimental-jit --enable-optimizations --with-readline=readline --without-valgrind --with-lto
And the test (test_readline) no longer fails. gpshead commented on Sep 8, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|