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 — 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 #123018

New issue
Copy link
New issue
Copy link
Closed
Closed
Python limited history test fails when configured to use editline instead of readline#123018
Copy link
Assignees
gpshead
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@threexc
threexc
opened on Aug 14, 2024
Issue body actions

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

Linked PRs

  • gh-123018: Keep the libedit history file header when truncating #157165
  • [3.15] gh-123018: Keep the libedit history file header when truncating (GH-157165) #157172
  • [3.14] gh-123018: Keep the libedit history file header when truncating (GH-157165) #157173
Reacted by Bartosz Sławecki and Gregory P. Smith

Activity

  1. threexc
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Aug 14, 2024
  2. 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[/+] on Aug 14, 2024
  3. brainhoard-github
    added a commit that references this issue on Aug 15, 2024

    python3: skip readline limited history tests

    e087cc0
  4. picnixz
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    on Aug 15, 2024
  5. sobolevn commented on Aug 15, 2024

    @sobolevn
    sobolevn
    on Aug 15, 2024
    Member
    More actions

    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
    
  6. halstead
    added 2 commits that reference this issue on Aug 15, 2024

    python3: skip readline limited history tests

    96b6127

    python3: skip readline limited history tests

    de569dd
  7. threexc commented on Aug 15, 2024

    @threexc
    threexc
    on Aug 15, 2024
    Author
    More actions

    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?

  8. threexc commented on Aug 15, 2024

    @threexc
    threexc
    on Aug 15, 2024
    Author
    More actions

    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
    
  9. rossburton commented on Sep 12, 2024

    @rossburton
    rossburton
    on Sep 12, 2024
    Contributor
    More actions

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

  10. brainhoard-github
    added 3 commits that reference this issue on Sep 19, 2024

    python3: skip readline limited history tests

    e04c945

    python3: skip readline limited history tests

    b2ddbc9

    python3: skip readline limited history tests

    5899955
  11. halstead
    added 2 commits that reference this issue on Sep 25, 2024

    python3: skip readline limited history tests

    98b3a3e

    python3: skip readline limited history tests

    b9a2619
  12. jpuhlman
    added a commit that references this issue on Oct 1, 2024

    python3: skip readline limited history tests

    f87225a
  13. jpuhlman
    added a commit that references this issue on Oct 17, 2024

    python3: skip readline limited history tests

    1b33774
  14. pepoluan commented on Oct 29, 2024

    @pepoluan
    pepoluan
    on Oct 29, 2024
    Contributor
    More actions

    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.

  15. gpshead
    self-assigned this
    on Sep 8, 2026
  16. gpshead commented on Sep 8, 2026

    @gpshead
    gpshead
    on Sep 8, 2026
    Member
    More actions

    macOS libedit contains a patch fixing this. upstream (netbsd) does not appear to have that.

    It can be worked around in cpython.

    Upstream NetBSD bug https://gnats.netbsd.org/60322

  17. gpshead
    added 4 commits that reference this issue on Sep 8, 2026

    pythongh-123018: Keep the libedit history file header when truncating

    39d13be

    pythongh-123018: Keep the libedit history file header when truncating

    9b6d270

    gh-123018: Keep the libedit history file header when truncating (GH-1…

    2638785

    [3.14] gh-123018: Keep the libedit history file header when truncating (

    e87da80
  18. maurycy
    added a commit that references this issue on Sep 10, 2026

    Merge branch 'main' into tachyon-native-callable

    e028ff5
  19. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-123018: Keep the libedit history file header when truncating (…

    714434d
  20. johnslavik
    added a commit that references this issue on Sep 14, 2026

    pythongh-123018: Keep the libedit history file header when truncating (…

    21db1b7
  21. gpshead
    added a commit that references this issue on Oct 10, 2026

    [3.15] gh-123018: Keep the libedit history file header when truncating (

    d59ff39
  22. StanFromIreland
    closed this as completedon Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @gpshead
    gpshead

Labels

testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.