GeezerVison is showing github.com — gh-157159: improve the tabnanny usage message by gpshead · Pull Request #157160 · python/cpython
Conversation
gpshead
commented
Sep 8, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
The usage message embedded sys.argv[0], which under python -m tabnanny is the absolute path of tabnanny.py, and a meaningless virtual path when the standard library is in a zip archive or embedded in an executable. Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..." instead, and make the test expect that form instead of a file that may not exist.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The usage message embedded sys.argv[0], which under `python -m tabnanny`
is the absolute path of tabnanny.py, and a meaningless virtual path when
the standard library is in a zip archive or embedded in an executable.
Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
instead, and make the test expect that fixed form.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gpshead
added a commit
that referenced
this pull request
Sep 8, 2026
…7166)
gh-157159: improve the tabnanny usage message (GH-157160)
The usage message embedded sys.argv[0], which under `python -m tabnanny`
is the absolute path of tabnanny.py, and a meaningless virtual path when
the standard library is in a zip archive or embedded in an executable.
Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
instead, and make the test expect that fixed form.
(cherry picked from commit 5ddd59f)
Co-authored-by: Gregory P. Smith <[email protected]>
gpshead
added a commit
that referenced
this pull request
Sep 8, 2026
…7164)
gh-157159: improve the tabnanny usage message (GH-157160)
The usage message embedded sys.argv[0], which under `python -m tabnanny`
is the absolute path of tabnanny.py, and a meaningless virtual path when
the standard library is in a zip archive or embedded in an executable.
Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
instead, and make the test expect that fixed form.
(cherry picked from commit 5ddd59f)
Co-authored-by: Gregory P. Smith <[email protected]>
hugovk
pushed a commit
that referenced
this pull request
Sep 8, 2026
…7163)
gh-157159: improve the tabnanny usage message (GH-157160)
The usage message embedded sys.argv[0], which under `python -m tabnanny`
is the absolute path of tabnanny.py, and a meaningless virtual path when
the standard library is in a zip archive or embedded in an executable.
Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
instead, and make the test expect that fixed form.
(cherry picked from commit 5ddd59f)
Co-authored-by: Gregory P. Smith <[email protected]>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Arch Linux Asan Debug 3.13 (tierless) has failed when building commit 59f15f3.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1439/builds/1222) and take a look at the build logs.
- Check if the failure is related to this commit (59f15f3) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#/builders/1439/builds/1222
Failed tests:
Failed subtests:
- test_daemon_threads_shutdown_stdout_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stdout_deadlock
- test_daemon_threads_shutdown_stderr_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stderr_deadlock
Summary of the results of the build (if available):
==
Click to see traceback logs
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4821, in test_daemon_threads_shutdown_stderr_deadlock
self.check_daemon_threads_shutdown_deadlock('stderr')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4809, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: Regex didn't match: "Fatal Python error: _enter_buffered_busy: could not acquire lock for <(_io\\.)?BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads" not found in '....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4821, in test_daemon_threads_shutdown_stderr_deadlock
self.check_daemon_threads_shutdown_deadlock('stderr')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4809, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: Regex didn't match: "Fatal Python error: _enter_buffered_busy: could not acquire lock for <(_io\\.)?BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads" not found in '...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4816, in test_daemon_threads_shutdown_stdout_deadlock
self.check_daemon_threads_shutdown_deadlock('stdout')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4809, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: Regex didn't match: "Fatal Python error: _enter_buffered_busy: could not acquire lock for <(_io\\.)?BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads" not found in '=================================================================\n==350361==ERROR: AddressSanitizer: heap-use-after-free on address 0x7caaf2870d68 at pc 0x55ee59b832c7 bp 0x7b7af05fdff0 sp 0x7b7af05fdfe0\nREAD of size 8 at 0x7caaf2870d68 thread T1\n #0 0x55ee59b832c6 in _Py_atomic_load_uintptr_relaxed Include/cpython/pyatomic_gcc.h:347\n #1 0x55ee59b832c6 in _Py_eval_breaker_bit_is_set Include/internal/pycore_ceval.h:292\n #2 0x55ee59b832c6 in drop_gil Python/ceval_gil.c:266\n #3 0x55ee59b85286 in _PyEval_ReleaseLock Python/ceval_gil.c:603\n #4 0x55ee59bf113f in detach_thread Python/pystate.c:2152\n #5 0x55ee59bf392f in _PyThreadState_Detach Python/pystate.c:2158\n #6 0x55ee59b85476 in PyEval_SaveThread Python/ceval_gil.c:647\n #7 0x55ee59cbe071 in _enter_buffered_busy Modules/_io/bufferedio.c:302\n #8 0x55ee59cc32ae in _io_BufferedWriter_write_impl Modules/_io/bufferedio.c:2078\n #9 0x55ee59cc4271 in _io_BufferedWriter_write Modules/_io/clinic/bufferedio.c.h:1095\n #10 0x55ee598a21af in method_vectorcall_O Objects/descrobject.c:475\n #11 0x55ee59885b0d in _PyObject_VectorcallTstate Include/internal/pycore_call.h:168\n #12 0x55ee59887448 in PyObject_VectorcallMethod Objects/call.c:857\n #13 0x55ee59ccb70e in PyObject_CallMethodOneArg Include/cpython/abstract.h:74\n #14 0x55ee59cd0539 in _textiowrapper_writeflush Modules/_io/textio.c:1631\n #15 0x55ee59cd0cdc in _io_TextIOWrapper_flush_impl Modules/_io/textio.c:3121\n #16 0x55ee59cd0f2b in _io_TextIOWrapper_flush Modules/_io/clinic/textio.c.h:1111\n #17 0x55ee59aeb262 in _PyEval_EvalFrameDefault Python/generated_cases.c.h:1753\n #18 0x55ee59b0dc69 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:120\n #19 0x55ee59b0de56 in _PyEval_Vector Python/ceval.c:1820\n #20 0x55ee5988560a in _PyFunction_Vectorcall Objects/call.c:413\n #21 0x55ee5988b6f0 in _PyObject_VectorcallTstate Include/internal/pycore_call.h:168\n #22 0x55ee5988bba1 in method_vectorcall Objects/classobject.c:71\n #23 0x55ee59888f3a in _PyVectorcall_Call Objects/call.c:273\n #24 0x55ee5988943d in _PyObject_Call Objects/call.c:348\n #25 0x55ee59889484 in PyObject_Call Objects/call.c:373\n #26 0x55ee59d2736c in thread_run Modules/_threadmodule.c:343\n #27 0x55ee59c28acd in pythread_wrapper Python/thread_pthread.h:242\n #28 0x7f7af3e61858 (/usr/lib/libasan.so.8+0x61858) (BuildId: b28f87d70f4aadfdfe6abce3776c226f5569bd6a)\n #29 0x7f7af3a97738 (/usr/lib/libc.so.6+0x97738) (BuildId: d8ceb52a8c6e1fefece4ca75f7396d1d5bffc565)\n #30 0x7f7af3b1bedb (/usr/lib/libc.so.6+0x11bedb) (BuildId: d8ceb52a8c6e1fefece4ca75f7396d1d5bffc565)\n\n0x7caaf2870d68 is located 40 bytes inside of 368-byte region [0x7caaf2870d40,0x7caaf2870eb0)\nfreed by thread T0 here:\n #0 0x7f7af3f2ae91 (/usr/lib/libasan.so.8+0x12ae91) (BuildId: b28f87d70f4aadfdfe6abce3776c226f5569bd6a)\n #1 0x55ee59942b0f in _PyMem_RawFree Objects/obmalloc.c:90\n #2 0x55ee59944da1 in _PyMem_DebugRawFree Objects/obmalloc.c:2860\n #3 0x55ee5996babd in PyMem_RawFree Objects/obmalloc.c:1005\n #4 0x55ee59bf0318 in free_threadstate Python/pystate.c:1471\n #5 0x55ee59bf6671 in _PyThreadState_DeleteList Python/pystate.c:1941\n #6 0x55ee59bec89f in _Py_Finalize Python/pylifecycle.c:2092\n #7 0x55ee59beca1d in Py_FinalizeEx Python/pylifecycle.c:2261\n #8 0x55ee59c5321e in Py_RunMain Modules/main.c:836\n #9 0x55ee59c533fa in pymain_main Modules/main.c:864\n #10 0x55ee59c53785 in Py_BytesMain Modules/main.c:888\n #11 0x55ee596f4a81 in main Programs/python.c:15\n #12 0x7f7af3a27740 (/usr/lib/libc.so.6+0x27740) (BuildId: d8ceb52a8c6e1fefece4ca75f7396d1d5bffc565)\n #13 0x7f7af3a27878 in __libc_start_main (/usr/lib/libc.so.6+0x27878) (BuildId: d8ceb52a8c6e1fefece4ca75f7396d1d5bffc565)\n #14 0x55ee596f49a4 in _start (/buildbot/b
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4816, in test_daemon_threads_shutdown_stdout_deadlock
self.check_daemon_threads_shutdown_deadlock('stdout')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4809, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
clin1234
pushed a commit
to clin1234/cpython
that referenced
this pull request
Sep 12, 2026
The usage message embedded sys.argv[0], which under `python -m tabnanny`
is the absolute path of tabnanny.py, and a meaningless virtual path when
the standard library is in a zip archive or embedded in an executable.
Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
instead, and make the test expect that fixed form.
johnslavik
pushed a commit
to johnslavik/cpython
that referenced
this pull request
Sep 14, 2026
The usage message embedded sys.argv[0], which under `python -m tabnanny`
is the absolute path of tabnanny.py, and a meaningless virtual path when
the standard library is in a zip archive or embedded in an executable.
Print f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
instead, and make the test expect that fixed form.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|