Skip to content

test.test_pyrepl.test_pyrepl.TestMain.test_readline_history_file fails on MacOS with TERM=dumb #123870

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

Closed
diegorusso opened this issue Sep 9, 2024 · 5 comments
Labels
OS-mac tests Tests in the Lib/test dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@diegorusso
Copy link
Contributor

diegorusso commented Sep 9, 2024

Bug report

Bug description:

Hello,

I've seen already issues with TERM=dumb and pyrepl but I haven't seen any specific to MacOS. We discovered this on our CI based on Jenkins but I was able to replicate it on my Mac as well hence reporting the issue.
readline is installed via brew

Note: the same steps work on Linux.

$ export TERM=dumb
$ export EXTRATESTOPTS="test_pyrepl"
$ make test
Checked 112 modules (34 built-in, 78 shared, 0 n/a on macosx-14.6-arm64, 0 disabled, 0 missing, 0 failed on import)
./python.exe -E  -m test --fast-ci --timeout= test_pyrepl
+ ./python.exe -u -W default -bb -E -m test --fast-ci --timeout= test_pyrepl --dont-add-python-opts
...
...
======================================================================
FAIL: test_readline_history_file (test.test_pyrepl.test_pyrepl.TestMain.test_readline_history_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dierus01/Work/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 1305, in test_readline_history_file
    output, exit_code = self.run_repl("exit\n", env=env)
                        ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/Users/dierus01/Work/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 1225, in run_repl
    return self._run_repl(
           ~~~~~~~~~~~~~~^
        repl_input, env=env, cmdline_args=cmdline_args, cwd=cwd
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/dierus01/Work/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 1276, in _run_repl
    self.fail(f"Timeout while waiting for output, got: {''.join(output)}")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Timeout while waiting for output, got: exit
Python 3.14.0a0 (heads/main-dirty:7e12f70965, Sep  9 2024, 11:46:26) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
warning: can't use pyrepl: terminal doesn't have the required clear capability
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>>

----------------------------------------------------------------------
Ran 145 tests in 31.105s

FAILED (failures=1, skipped=10)
test test_pyrepl failed

== Tests result: FAILURE ==

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

@diegorusso diegorusso added the type-bug An unexpected behavior, bug, or error label Sep 9, 2024
@Eclips4 Eclips4 added tests Tests in the Lib/test dir OS-mac topic-repl Related to the interactive shell labels Sep 9, 2024
@Eclips4
Copy link
Member

Eclips4 commented Sep 9, 2024

Thanks for the report!
Confirmed on current main + macOS.

@skirpichev
Copy link
Contributor

Not sure if this is related, but here is builtbot failure with timeout:
https://buildbot.python.org/#/builders/1483/builds/97/steps/6/logs/stdio

@diegorusso
Copy link
Contributor Author

diegorusso commented Sep 11, 2024

I would say that this is exactly the same problem. Thanks @skirpichev for pointing that out. @ambv is already aware of the issue.

@emilyemorehouse
Copy link
Member

Thanks all! This is fixed via #124396

@diegorusso
Copy link
Contributor Author

Emily, it is fixed indeed! Thanks for your PR! 🎉

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

No branches or pull requests

4 participants