Issue #16414: Add support.FS_NONASCII and support.TESTFN_NONASCII

These constants are used to test functions with non-ASCII data, especially
filenames.
This commit is contained in:
Victor Stinner 2012-11-06 23:23:43 +01:00
parent df1d940c7c
commit 8b219b2936
5 changed files with 42 additions and 12 deletions

View file

@ -1243,6 +1243,8 @@ if sys.platform != 'win32':
def setUp(self):
if support.TESTFN_UNENCODABLE:
self.dir = support.TESTFN_UNENCODABLE
elif support.TESTFN_NONASCII:
self.dir = support.TESTFN_NONASCII
else:
self.dir = support.TESTFN
self.bdir = os.fsencode(self.dir)
@ -1257,6 +1259,8 @@ if sys.platform != 'win32':
add_filename(support.TESTFN_UNICODE)
if support.TESTFN_UNENCODABLE:
add_filename(support.TESTFN_UNENCODABLE)
if support.TESTFN_NONASCII:
add_filename(support.TESTFN_NONASCII)
if not bytesfn:
self.skipTest("couldn't create any non-ascii filename")