bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278)
This commit is contained in:
parent
6ea9d54dea
commit
8752dfbd1f
|
@ -871,7 +871,11 @@ for character in (
|
||||||
'\u20AC',
|
'\u20AC',
|
||||||
):
|
):
|
||||||
try:
|
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:
|
except UnicodeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue