From c0a9d4152d78da943b1d63727d0f79b9da751eb1 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Tue, 2 Mar 2010 22:34:11 +0000 Subject: Test test_pep277 is only relevant for Unicode-friendly filesystems. --- Lib/test/test_pep277.py | 10 ++++++---- Misc/NEWS | 3 ++- 2 files changed, 8 insertions(+), 5 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) diff --git a/Misc/NEWS b/Misc/NEWS index d386c2f..a02681a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -106,7 +106,8 @@ Extension Modules 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. -- cgit v0.12