Commit 8752dfbd authored by native-api's avatar native-api Committed by Serhiy Storchaka

bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278)

parent 6ea9d54d
......@@ -871,7 +871,11 @@ for character in (
'\u20AC',
):
try:
os.fsdecode(os.fsencode(character))
# If Python is set up to use the legacy 'mbcs' in Windows,
# 'replace' error mode is used, and encode() returns b'?'
# for characters missing in the ANSI codepage
if os.fsdecode(os.fsencode(character)) != character:
raise UnicodeError
except UnicodeError:
pass
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment