Skip to content
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

Python limited history test fails when configured to use editline instead of readline #123018

Open
threexc opened this issue Aug 14, 2024 · 5 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@threexc
Copy link

threexc commented Aug 14, 2024

Bug 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

@threexc threexc added the type-bug An unexpected behavior, bug, or error label Aug 14, 2024
@threexc threexc changed 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 Aug 14, 2024
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this issue Aug 15, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: 2c9d2100fb6fdb600f441330e0c6b62782e36698)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
@picnixz picnixz added the tests Tests in the Lib/test dir label Aug 15, 2024
@sobolevn
Copy link
Member

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

halstead pushed a commit to yoctoproject/poky that referenced this issue Aug 15, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this issue Aug 15, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
@threexc
Copy link
Author

threexc commented 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
Copy link
Author

threexc commented 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

daregit pushed a commit to daregit/yocto-combined that referenced this issue Aug 15, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

Signed-off-by: Trevor Gamblin <tgamblinbaylibre.com>
Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Aug 18, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

Signed-off-by: Trevor Gamblin <tgamblinbaylibre.com>
Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Aug 18, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

Signed-off-by: Trevor Gamblin <tgamblinbaylibre.com>
Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Aug 19, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

Signed-off-by: Trevor Gamblin <tgamblinbaylibre.com>
Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
@rossburton
Copy link
Contributor

FYI, we've replicated this failure with Python 3.12.6.

brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this issue Sep 19, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

(From OE-Core rev: 98b3a3e3f79a3edaa4cf2cfbf58eb84553d65e1e)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this issue Sep 21, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

(From OE-Core rev: 98b3a3e3f79a3edaa4cf2cfbf58eb84553d65e1e)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Sep 22, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

Signed-off-by: Trevor Gamblin <tgamblinbaylibre.com>
Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this issue Sep 25, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

(From OE-Core rev: 98b3a3e3f79a3edaa4cf2cfbf58eb84553d65e1e)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
halstead pushed a commit to openembedded/openembedded-core that referenced this issue Sep 25, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569dd)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
halstead pushed a commit to yoctoproject/poky that referenced this issue Sep 25, 2024
Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

(From OE-Core rev: 98b3a3e3f79a3edaa4cf2cfbf58eb84553d65e1e)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/poky that referenced this issue Oct 1, 2024
Source: poky
MR: 166944
Type: Integration
Disposition: Merged from poky
ChangeID: b9a2619
Description:

Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

(From OE-Core rev: 98b3a3e3f79a3edaa4cf2cfbf58eb84553d65e1e)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/poky that referenced this issue Oct 17, 2024
Source: poky
MR: 166944
Type: Integration
Disposition: Merged from poky
ChangeID: b9a2619
Description:

Python 3.12.5 is failing a newer ptest for reading/writing limited
history when editline (default) is set in PACKAGECONFIG. Skip it for now
until a proper fix (if any) is determined.

A bug has been opened upstream: python/cpython#123018

(From OE-Core rev: de569ddffd5ea36b70c56df21dec9c892e5dee7d)

(From OE-Core rev: 98b3a3e3f79a3edaa4cf2cfbf58eb84553d65e1e)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
@pepoluan
Copy link
Contributor

pepoluan commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants