We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ea9d54 commit 8752dfbCopy full SHA for 8752dfb
Lib/test/support/__init__.py
@@ -871,7 +871,11 @@ def dec(*args, **kwargs):
871
'\u20AC',
872
):
873
try:
874
- os.fsdecode(os.fsencode(character))
+ # If Python is set up to use the legacy 'mbcs' in Windows,
875
+ # 'replace' error mode is used, and encode() returns b'?'
876
+ # for characters missing in the ANSI codepage
877
+ if os.fsdecode(os.fsencode(character)) != character:
878
+ raise UnicodeError
879
except UnicodeError:
880
pass
881
else:
0 commit comments