This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Arfrever, doko, ezio.melotti, iritkatriel, martin.panter, nadeem.vawda, petri.lehtinen, python-dev, serhiy.storchaka, vstinner
Date 2022-01-17.11:33:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642419190.99.0.129955571682.issue13886@roundup.psfhosted.org>
In-reply-to
Content
Oh, the test_builtin.test_input_tty_non_ascii() fails just if test_readline is loaded previously:

$ ./python -E -m test -m test.test_builtin.PtyTests.test_input_tty_non_ascii -v test_readline test_builtin
== CPython 3.11.0a4+ (heads/main:7f4b69b9076, Jan 17 2022, 12:28:15) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)]
== Linux-5.15.12-200.fc35.x86_64-x86_64-with-glibc2.34 little-endian
== cwd: /home/vstinner/python/main/build/test_python_49429æ
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.48 Run tests sequentially
0:00:00 load avg: 0.48 [1/2] test_readline

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
0:00:00 load avg: 0.48 [2/2] test_builtin -- test_readline ran no tests
test_input_tty_non_ascii (test.test_builtin.PtyTests) ... FAIL

======================================================================
FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2095, in test_input_tty_non_ascii
    self.check_input_tty("prompté", b"quux\xe9", "utf-8")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2086, in check_input_tty
    self.assertEqual(input_result, expected)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'quux' != 'quux\udce9'
- quux
+ quux\udce9
?     +


----------------------------------------------------------------------
Ran 1 test in 0.013s

FAILED (failures=1)
test test_builtin failed
test_builtin failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_builtin

1 test run no tests:
    test_readline

Total duration: 559 ms
Tests result: FAILURE


In just, just importing readline is enough to make the test fails:

$ git diff Lib/test/test_builtin.py
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 6dc4fa55502..20d3d33d9fb 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1,3 +1,5 @@
+import readline
+
 # Python test set -- built-in functions
 
 import ast


$ ./python -E -m test -m test.test_builtin.PtyTests.test_input_tty_non_ascii -v test_builtin
(...)

======================================================================
FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2097, in test_input_tty_non_ascii
    self.check_input_tty("prompté", b"quux\xe9", "utf-8")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2088, in check_input_tty
    self.assertEqual(input_result, expected)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'quux' != 'quux\udce9'
- quux
+ quux\udce9
?     +

(...)
History
Date User Action Args
2022-01-17 11:33:11vstinnersetrecipients: + vstinner, doko, nadeem.vawda, ezio.melotti, Arfrever, python-dev, petri.lehtinen, martin.panter, serhiy.storchaka, iritkatriel
2022-01-17 11:33:10vstinnersetmessageid: <1642419190.99.0.129955571682.issue13886@roundup.psfhosted.org>
2022-01-17 11:33:10vstinnerlinkissue13886 messages
2022-01-17 11:33:10vstinnercreate