diff options
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r-- | Lib/test/support.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index c5640e0..93b94d9 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -647,6 +647,17 @@ elif sys.platform != 'darwin': # the byte 0xff. Skip some unicode filename tests. pass +# TESTFN_UNDECODABLE is a filename (bytes type) that should *not* be able to be +# decoded from the filesystem encoding (in strict mode). It can be None if we +# cannot generate such filename. +TESTFN_UNDECODABLE = None +for name in (b'abc\xff', b'\xe7w\xf0'): + try: + os.fsdecode(name) + except UnicodeDecodeError: + TESTFN_UNDECODABLE = name + break + # Save the initial cwd SAVEDCWD = os.getcwd() |