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
On FreeBSD, Python 3 doesn't support support the POSIX locale #78708
Comments
vstinner@freebsd$ env -i LC_ALL=POSIX ./python -m test -v test_cmd_line_script -m test_non_ascii ====================================================================== Traceback (most recent call last):
File "/usr/home/vstinner/prog/python/master/Lib/test/test_cmd_line_script.py", line 512, in test_non_ascii
'stdout=%r stderr=%r' % (stdout, stderr))
AssertionError: "'./@test_13073_tmp\\udce7w\\udcf0.py'" != "'<filename encoding error>'"
- './@test_13073_tmp\udce7w\udcf0.py'
+ '<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) == Tests result: FAILURE == 1 test failed: Total duration: 170 ms 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: https://www.python.org/dev/peps/pep-0540/#abstract
|
Note: Python 2.7 is not affected: it doesn't have "force_ascii" and "LC_ALL=POSIX ./python -m test test_cmd_line_script" pass successfully. |
I wanted to quickly fix this issue since I'm working on 3 different issues where I got conflicts with these changes, and the other issues were impacted by this bug. I sent an email to python-dev about this issue: |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: