[Python-checkins] r78594 - in python/trunk: Lib/test/test_pep277.py Misc/NEWS
florent.xicluna
python-checkins at python.org
Tue Mar 2 23:34:11 CET 2010
Author: florent.xicluna
Date: Tue Mar 2 23:34:11 2010
New Revision: 78594
Log:
Test test_pep277 is only relevant for Unicode-friendly filesystems.
Modified:
python/trunk/Lib/test/test_pep277.py
python/trunk/Misc/NEWS
Modified: python/trunk/Lib/test/test_pep277.py
==============================================================================
--- python/trunk/Lib/test/test_pep277.py (original)
+++ python/trunk/Lib/test/test_pep277.py Tue Mar 2 23:34:11 2010
@@ -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 @@
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)
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Tue Mar 2 23:34:11 2010
@@ -106,7 +106,8 @@
Tests
-----
-- Issue #767675: enable test_pep277 on all platforms.
+- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
+ filesystem encoding.
- Issue #6292: for the moment at least, the test suite runs cleanly if python
is run with the -OO flag. Tests requiring docstrings are skipped.
More information about the Python-checkins
mailing list