diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-15 19:28:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-15 19:28:21 (GMT) |
commit | a0241c8587fb15ccfb161762754e65c4cc11d421 (patch) | |
tree | 270ae6e29392848d32bcb1b6aac6d8f44509c6f7 | |
parent | 4045575dd5a8605782fa2b6e3e734c28e529b27d (diff) | |
download | cpython-a0241c8587fb15ccfb161762754e65c4cc11d421.zip cpython-a0241c8587fb15ccfb161762754e65c4cc11d421.tar.gz cpython-a0241c8587fb15ccfb161762754e65c4cc11d421.tar.bz2 |
Fix TESTFN_UNENCODABLE of test.support on Mac OS X
-rw-r--r-- | Lib/test/support.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index 963a2a7..c69dd94 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -386,11 +386,10 @@ TESTFN_ENCODING = sys.getfilesystemencoding() # TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be # encoded by the filesystem encoding (in strict mode). It can be None if we # cannot generate such filename. +TESTFN_UNENCODABLE = None if os.name in ('nt', 'ce'): - if sys.getwindowsversion().platform < 2: - # win32s (0) or Windows 9x/ME (1) - TESTFN_UNENCODABLE = None - else: + # skip win32s (0) or Windows 9x/ME (1) + if sys.getwindowsversion().platform >= 2: # Japanese characters (I think - from bug 846133) TESTFN_UNENCODABLE = TESTFN + "-\u5171\u6709\u3055\u308c\u308b" try: @@ -402,8 +401,8 @@ if os.name in ('nt', 'ce'): 'Unicode filename tests may not be effective' % (TESTFN_UNENCODABLE, TESTFN_ENCODING)) TESTFN_UNENCODABLE = None +# Mac OS X denies unencodable filenames (invalid utf-8) elif sys.platform != 'darwin': - # Mac OS X denies unencodable filenames (invalid utf-8) try: # ascii and utf-8 cannot encode the byte 0xff b'\xff'.decode(TESTFN_ENCODING) @@ -414,7 +413,7 @@ elif sys.platform != 'darwin': else: # File system encoding (eg. ISO-8859-* encodings) can encode # the byte 0xff. Skip some unicode filename tests. - TESTFN_UNENCODABLE = None + pass # Save the initial cwd SAVEDCWD = os.getcwd() |