summaryrefslogtreecommitdiffstats
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-18 10:56:19 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-18 10:56:19 (GMT)
commitd91df1a7a961e15b0602cd19155ea9cdf08a9e07 (patch)
tree5f7d69bc9c2d5568f92cae3fa84ab78677c5478e /Lib/test/support.py
parent6c00c1464f03deaafbbd5fdd212514cbf36b9bd4 (diff)
downloadcpython-d91df1a7a961e15b0602cd19155ea9cdf08a9e07.zip
cpython-d91df1a7a961e15b0602cd19155ea9cdf08a9e07.tar.gz
cpython-d91df1a7a961e15b0602cd19155ea9cdf08a9e07.tar.bz2
Improve PEP 383 tests (in test_os)
* Use the current filesystem encoding instead of always using utf-8 * Enable the test on Mac OS X * Use TESTFN_UNENCODABLE and TESTFN_UNICODE instead of arbitrary filenames * To decode a filename, use strict error handler instead surrogateescape for mbcs encoding (on Windows) * Use TESTFN_UNENCODABLE (if available) for the directory name Skip the test if no non-ascii filename can be created.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 8a8e410..a70fee4 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -377,10 +377,8 @@ else:
TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
-# Assuming sys.getfilesystemencoding()!=sys.getdefaultencoding()
-# TESTFN_UNICODE is a filename that can be encoded using the
-# file system encoding, but *not* with the default (ascii) encoding
-TESTFN_UNICODE = TESTFN + "-\xe0\xf2"
+# TESTFN_UNICODE is a non-ascii filename
+TESTFN_UNICODE = TESTFN + "-\xe0\xf2\u0258\u0141\u011f"
TESTFN_ENCODING = sys.getfilesystemencoding()
# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be