summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-02 22:34:11 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-02 22:34:11 (GMT)
commitc0a9d4152d78da943b1d63727d0f79b9da751eb1 (patch)
tree1e63e087d0a121ccef75e80407a5cdd1096eb7dc /Lib
parentfa31eaa5f6b831ea6c4e5c8e555b9fb07d47affa (diff)
downloadcpython-c0a9d4152d78da943b1d63727d0f79b9da751eb1.zip
cpython-c0a9d4152d78da943b1d63727d0f79b9da751eb1.tar.gz
cpython-c0a9d4152d78da943b1d63727d0f79b9da751eb1.tar.bz2
Test test_pep277 is only relevant for Unicode-friendly filesystems.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_pep277.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index e5f538e..9a4c3bb 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -2,9 +2,6 @@
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from test import test_support
-## There's no obvious reason to skip these tests on POSIX systems
-# if not os.path.supports_unicode_filenames:
-# raise unittest.SkipTest, "test works only on NT+"
filenames = [
'abc',
@@ -37,7 +34,12 @@ class UnicodeFileTests(unittest.TestCase):
except OSError:
pass
for name in self.files:
- f = open(name, 'w')
+ try:
+ f = open(name, 'w')
+ except UnicodeEncodeError:
+ if not os.path.supports_unicode_filenames:
+ raise unittest.SkipTest("test works only on NT+, and with "
+ "pseudo-Unicode filesystems")
f.write((name+'\n').encode("utf-8"))
f.close()
os.stat(name)