From: Brian Curtin Date: Tue, 30 Nov 2010 15:40:04 +0000 (+0000) Subject: Try to fix failures on platforms that can't encode the test characters. X-Git-Tag: v3.2b1~163 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43f0c27be78ce11d871c8a80ec1251cc82010d19;p=thirdparty%2FPython%2Fcpython.git Try to fix failures on platforms that can't encode the test characters. Skip the test if encoding fails. --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 5a37522ad82e..d58097dc5c32 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)