diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pep277.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index e5f538e024..9a4c3bba35 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) |