Commit 74a833fa authored by Victor Stinner's avatar Victor Stinner

Decompose TESTFN_UNICODE on Mac OS X

parent b85e1656
...@@ -379,6 +379,12 @@ TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid()) ...@@ -379,6 +379,12 @@ TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
# TESTFN_UNICODE is a non-ascii filename # TESTFN_UNICODE is a non-ascii filename
TESTFN_UNICODE = TESTFN + "-\xe0\xf2\u0258\u0141\u011f" 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_ENCODING = sys.getfilesystemencoding()
# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be # TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment