diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2002-10-08 02:44:31 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2002-10-08 02:44:31 (GMT) |
commit | 8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df (patch) | |
tree | 1d688f1ea3f3b785a19760dd1477b796370c698d /Lib/test | |
parent | 20eae69a9fb5b5453f9ddf01600f99fd6ffffed7 (diff) | |
download | cpython-8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df.zip cpython-8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df.tar.gz cpython-8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df.tar.bz2 |
Add os.path.supports_unicode_filenames for all platforms,
sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink>
version), and fix test_pep277.py in a few minor ways.
Including doc and NEWS entries.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/output/test_pep277 | 2 | ||||
-rw-r--r-- | Lib/test/test_pep277.py | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/output/test_pep277 b/Lib/test/output/test_pep277 index 717b707..43bd9e1 100644 --- a/Lib/test/output/test_pep277 +++ b/Lib/test/output/test_pep277 @@ -1,4 +1,4 @@ test_pep277 -u'F:\\src\\python-cvs\\Lib\\test\\@test\\Gr\xfc\xdf-\u66e8\u66e9\u66eb\\\xdf-\u66e8\u66e9\u66eb' +u'\xdf-\u66e8\u66e9\u66eb' ['???', '???', '??????', '????????????', '????G\xdf', 'Ge??-sa?', 'Gr\xfc\xdf-Gott', 'abc', 'ascii'] [u'Gr\xfc\xdf-Gott', u'abc', u'ascii', u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2', u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u306b\u307d\u3093', u'\u66e8\u05e9\u3093\u0434\u0393\xdf', u'\u66e8\u66e9\u66eb'] diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index 480fe00..9c4aa05 100644 --- a/Lib/test/test_pep277.py +++ b/Lib/test/test_pep277.py @@ -2,9 +2,7 @@ # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import os, unittest from test.test_support import TESTFN, TestSkipped, TestFailed, run_suite -try: - from nt import _getfullpathname -except ImportError: +if not os.path.supports_unicode_filenames: raise TestSkipped, "test works only on NT+" filenames = [ @@ -24,7 +22,8 @@ def deltree(dirname): # Don't hide legitimate errors: if one of these suckers exists, it's # an error if we can't remove it. if os.path.exists(dirname): - for fname in os.listdir(dirname): + # must pass unicode to os.listdir() so we get back unicode results. + for fname in os.listdir(unicode(dirname)): os.unlink(os.path.join(dirname, fname)) os.rmdir(dirname) @@ -99,7 +98,7 @@ class UnicodeFileTests(unittest.TestCase): f = open(filename, 'w') f.write((filename + '\n').encode("utf-8")) f.close() - print repr(_getfullpathname(filename)) + print repr(filename) os.remove(filename) os.chdir(oldwd) os.rmdir(dirname) |