-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
test.support.FS_NONASCII returns incorrect result in Windows with non-US locale #77890
Comments
This causes test_ntpath and test_posixpath to fail in subj. Sample failure: ====================================================================== Traceback (most recent call last):
File "c:\Users\Sasha\Documents\cpython\lib\test\test_genericpath.py", line 230
, in test_expandvars_nonascii
check(u'$spam bar', u'%s bar' % unonascii)
File "c:\Users\Sasha\Documents\cpython\lib\test\test_genericpath.py", line 214
, in check
self.assertEqual(expandvars(value), expected)
AssertionError: u'? bar' != u'\xe6 bar'
- ? bar
? ^
+ \xe6 bar
? ^ Cause: if sys.getfilesystemencoding()=='mbcs', encoding Unicode characters that are missing in the current locale succeeds but produces '?'. So, test.support.FS_NONASCII's test fails to detect if a character is present in the current locale. |
What is your Python version? Python uses UTF-8 to encode paths on Windows since Python 3.6: |
In 3.x, it turns out, this doesn't result in test failures in stock configuration. It does though if PYTHONLEGACYWINDOWSFSENCODING is in system environment. I was diagnosing failures in 2.x and saw that 3.x has the same logic, so it was a no-brainer to replicate the change... |
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: