$ PYTHONWARNINGS=error ./python -m test -v test_subprocess -m test_encoding_warning
== CPython 3.16.0a0 (heads/pr/6898-dirty:1a11bf9a3ad, Aug 10 2026, 16:52:00) [GCC 16.1.1 20260515 (Red Hat 16.1.1-2)]
== Linux-7.1.4-204.fc44.x86_64-x86_64-with-glibc2.43 little-endian
== Python build: debug
== cwd: /home/vstinner/python/main/build/test_python_worker_1320297æ
== CPU count: 10 (process) / 12 (system)
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests
Using random seed: 4243907712
0:00:00 load avg: 0.64 mem: 21.8 MiB Run 1 test sequentially in a single process
0:00:00 load avg: 0.64 mem: 21.8 MiB [1/1] test_subprocess
test_encoding_warning (test.test_subprocess.RunFuncTestCase.test_encoding_warning) ... FAIL
======================================================================
FAIL: test_encoding_warning (test.test_subprocess.RunFuncTestCase.test_encoding_warning)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/python/main/Lib/test/test_subprocess.py", line 2057, in test_encoding_warning
self.assertEqual(len(lines), 2, lines)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 16 != 2 : [b'Traceback (most recent call last):', b' File \x1b[35m"<string>"\x1b[0m, line \x1b[35m2\x1b[0m, in \x1b[35m<module>\x1b[0m', b' \x1b[31mrun\x1b[0m\x1b[1;31m("echo hello", shell=True, text=True)\x1b[0m', b' \x1b[31m~~~\x1b[0m\x1b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\x1b[0m', b' File \x1b[35m"/home/vstinner/python/main/Lib/subprocess.py"\x1b[0m, line \x1b[35m669\x1b[0m, in \x1b[35mrun\x1b[0m', b' with \x1b[31mPopen\x1b[0m\x1b[1;31m(*popenargs, **kwargs)\x1b[0m as process:', b' \x1b[31m~~~~~\x1b[0m\x1b[1;31m^^^^^^^^^^^^^^^^^^^^^^\x1b[0m', b' File \x1b[35m"/home/vstinner/python/main/Lib/subprocess.py"\x1b[0m, line \x1b[35m1064\x1b[0m, in \x1b[35m__init__\x1b[0m', b' self.encoding = encoding = \x1b[31m_text_encoding\x1b[0m\x1b[1;31m()\x1b[0m', b' \x1b[31m~~~~~~~~~~~~~~\x1b[0m\x1b[1;31m^^\x1b[0m', b' File \x1b[35m"/home/vstinner/python/main/Lib/subprocess.py"\x1b[0m, line \x1b[35m494\x1b[0m, in \x1b[35m_text_encoding\x1b[0m', b' \x1b[31mwarnings.warn\x1b[0m\x1b[1;31m("\'encoding\' argument not specified.",\x1b[0m', b' \x1b[31m~~~~~~~~~~~~~\x1b[0m\x1b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\x1b[0m', b' \x1b[1;31mEncodingWarning, stacklevel)\x1b[0m', b' \x1b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^\x1b[0m', b"\x1b[1;35mEncodingWarning\x1b[0m: \x1b[35m'encoding' argument not specified.\x1b[0m"]
----------------------------------------------------------------------
Ran 1 test in 0.139s
FAILED (failures=1)
test test_subprocess failed
0:00:00 load avg: 0.64 mem: 34.1 MiB [1/1/1] test_subprocess failed (1 failure)
== Tests result: FAILURE ==
1 test failed:
test_subprocess
Total duration: 443 ms
Total tests: run=1 (filtered) failures=1
Total test files: run=1/1 (filtered) failed=1
Result: FAILURE
I'm working on a fix.
Logs:
I'm working on a fix.
Linked PRs