mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Fix TESTFN_UNENCODABLE of test.support on Mac OS X
This commit is contained in:
parent
4045575dd5
commit
a0241c8587
1 changed files with 5 additions and 6 deletions
|
|
@ -386,11 +386,10 @@ 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
|
||||||
# encoded by the filesystem encoding (in strict mode). It can be None if we
|
# encoded by the filesystem encoding (in strict mode). It can be None if we
|
||||||
# cannot generate such filename.
|
# cannot generate such filename.
|
||||||
if os.name in ('nt', 'ce'):
|
|
||||||
if sys.getwindowsversion().platform < 2:
|
|
||||||
# win32s (0) or Windows 9x/ME (1)
|
|
||||||
TESTFN_UNENCODABLE = None
|
TESTFN_UNENCODABLE = None
|
||||||
else:
|
if os.name in ('nt', 'ce'):
|
||||||
|
# skip win32s (0) or Windows 9x/ME (1)
|
||||||
|
if sys.getwindowsversion().platform >= 2:
|
||||||
# Japanese characters (I think - from bug 846133)
|
# Japanese characters (I think - from bug 846133)
|
||||||
TESTFN_UNENCODABLE = TESTFN + "-\u5171\u6709\u3055\u308c\u308b"
|
TESTFN_UNENCODABLE = TESTFN + "-\u5171\u6709\u3055\u308c\u308b"
|
||||||
try:
|
try:
|
||||||
|
|
@ -402,8 +401,8 @@ if os.name in ('nt', 'ce'):
|
||||||
'Unicode filename tests may not be effective'
|
'Unicode filename tests may not be effective'
|
||||||
% (TESTFN_UNENCODABLE, TESTFN_ENCODING))
|
% (TESTFN_UNENCODABLE, TESTFN_ENCODING))
|
||||||
TESTFN_UNENCODABLE = None
|
TESTFN_UNENCODABLE = None
|
||||||
elif sys.platform != 'darwin':
|
|
||||||
# Mac OS X denies unencodable filenames (invalid utf-8)
|
# Mac OS X denies unencodable filenames (invalid utf-8)
|
||||||
|
elif sys.platform != 'darwin':
|
||||||
try:
|
try:
|
||||||
# ascii and utf-8 cannot encode the byte 0xff
|
# ascii and utf-8 cannot encode the byte 0xff
|
||||||
b'\xff'.decode(TESTFN_ENCODING)
|
b'\xff'.decode(TESTFN_ENCODING)
|
||||||
|
|
@ -414,7 +413,7 @@ elif sys.platform != 'darwin':
|
||||||
else:
|
else:
|
||||||
# File system encoding (eg. ISO-8859-* encodings) can encode
|
# File system encoding (eg. ISO-8859-* encodings) can encode
|
||||||
# the byte 0xff. Skip some unicode filename tests.
|
# the byte 0xff. Skip some unicode filename tests.
|
||||||
TESTFN_UNENCODABLE = None
|
pass
|
||||||
|
|
||||||
# Save the initial cwd
|
# Save the initial cwd
|
||||||
SAVEDCWD = os.getcwd()
|
SAVEDCWD = os.getcwd()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue