summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-11-30 15:40:04 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-11-30 15:40:04 (GMT)
commit43f0c27be78ce11d871c8a80ec1251cc82010d19 (patch)
tree55ec8258c103b882972d0ca577a5bbfdd0a2f427 /Lib/test
parent5aa580f27905d6e844e0ba6cf72b04f2d6d10987 (diff)
downloadcpython-43f0c27be78ce11d871c8a80ec1251cc82010d19.zip
cpython-43f0c27be78ce11d871c8a80ec1251cc82010d19.tar.gz
cpython-43f0c27be78ce11d871c8a80ec1251cc82010d19.tar.bz2
Try to fix failures on platforms that can't encode the test characters.
Skip the test if encoding fails.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 5a37522..d58097d 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -888,7 +888,12 @@ class LinkTests(unittest.TestCase):
bytes(self.file2, sys.getfilesystemencoding()))
def test_mbcs_name(self):
- self.file1 += "\u65e5\u672c"
+ try:
+ chars = os.fsencode("\u65e5\u672c")
+ except UnicodeError:
+ raise unittest.SkipTest("Unable to encode for this platform.")
+
+ self.file1 += chars
self.file2 = self.file1 + "2"
self._test_link(self.file1, self.file2)