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 ncoghlan, vstinner
Date 2018-08-28.09:35:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
vstinner@freebsd$ env -i LC_ALL=POSIX ./python -m test -v test_cmd_line_script  -m test_non_ascii
== CPython 3.8.0a0 (heads/master:096329f0b2, Aug 28 2018, 09:30:55) [Clang 4.0.0 (tags/RELEASE_400/final 297347)]
== FreeBSD-11.1-RELEASE-amd64-64bit-ELF little-endian
== cwd: /usr/home/vstinner/prog/python/master/build/test_python_13073
== CPU count: 2
== encodings: locale=US-ASCII, FS=ascii
Run tests sequentially
0:00:00 load avg: 0.48 [1/1] test_cmd_line_script
test_non_ascii (test.test_cmd_line_script.CmdLineTest) ... FAIL

FAIL: test_non_ascii (test.test_cmd_line_script.CmdLineTest)
Traceback (most recent call last):
  File "/usr/home/vstinner/prog/python/master/Lib/test/", line 512, in test_non_ascii
    'stdout=%r stderr=%r' % (stdout, stderr))
AssertionError: "'./@test_13073_tmp\\udce7w\\'" != "'<filename encoding error>'"
- './@test_13073_tmp\udce7w\'
+ '<filename encoding error>'
 : stdout=b"'<filename encoding error>'\n" stderr=b"Failed checking if argv[0] is an import path entry\nUnicodeEncodeError: 'ascii' codec can't encode character '\\xe7' in position 17: ordinal not in range(128)"

Ran 1 test in 0.093s

FAILED (failures=1)
test test_cmd_line_script failed
test_cmd_line_script failed

== Tests result: FAILURE ==

1 test failed:

Total duration: 170 ms
Tests result: FAILURE

By the way, the UTF-8 Mode is not enabled by the POSIX locale:

vstinner@freebsd$ env -i LC_ALL=POSIX ./python -c 'import sys; print(sys.flags.utf8_mode)'

It contradicts the PEP 540 which says the the UTF-8 Mode is enabled by the POSIX locale:

> This mode is off by default, but is automatically activated when using the "POSIX" locale.
Date User Action Args
2018-08-28 09:35:24vstinnersetrecipients: + vstinner, ncoghlan
2018-08-28 09:35:24vstinnersetmessageid: <>
2018-08-28 09:35:24vstinnerlinkissue34527 messages
2018-08-28 09:35:24vstinnercreate