diff --git a/Lib/test/support.py b/Lib/test/support.py index 42e2acb616f..54e05992018 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -408,7 +408,7 @@ def fcmp(x, y): # fuzzy comparison function b'\xff'.decode(TESTFN_ENCODING) except UnicodeDecodeError: # 0xff will be encoded using the surrogate character u+DCFF - TESTFN_UNENCODEABLE = TESTFN_UNICODE \ + TESTFN_UNENCODEABLE = TESTFN + b'-\xff'.decode(TESTFN_ENCODING, 'surrogateescape') else: # File system encoding (eg. ISO-8859-* encodings) can encode