summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-18 21:06:23 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-18 21:06:23 (GMT)
commit74a833fa9683283e722638fc3cd4cdd1aca160e5 (patch)
tree4282f39bf466aaf1fcfff643cecf626736edc8b5 /Lib
parentb85e165635889d9d736b7082c0e486217f2ca821 (diff)
downloadcpython-74a833fa9683283e722638fc3cd4cdd1aca160e5.zip
cpython-74a833fa9683283e722638fc3cd4cdd1aca160e5.tar.gz
cpython-74a833fa9683283e722638fc3cd4cdd1aca160e5.tar.bz2
Decompose TESTFN_UNICODE on Mac OS X
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/support.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index a70fee4..d0e84c7 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -379,6 +379,12 @@ TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
# TESTFN_UNICODE is a non-ascii filename
TESTFN_UNICODE = TESTFN + "-\xe0\xf2\u0258\u0141\u011f"
+if sys.platform == 'darwin':
+ # In Mac OS X's VFS API file names are, by definition, canonically
+ # decomposed Unicode, encoded using UTF-8. See QA1173:
+ # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html
+ import unicodedata
+ TESTFN_UNICODE = unicodedata.normalize('NFD', TESTFN_UNICODE)
TESTFN_ENCODING = sys.getfilesystemencoding()
# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be