diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-20 16:52:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-20 16:52:14 (GMT) |
commit | c44abb127b3567d7f371d84e767641649fa2137c (patch) | |
tree | 9f47bc03b5dbf0151996e470421bdbb03b3d4390 /Lib/test/test_os.py | |
parent | 1b6372a1d1e0b68e6b29e02fd1af8c721aeaa52b (diff) | |
download | cpython-c44abb127b3567d7f371d84e767641649fa2137c.zip cpython-c44abb127b3567d7f371d84e767641649fa2137c.tar.gz cpython-c44abb127b3567d7f371d84e767641649fa2137c.tar.bz2 |
Workaround issue #8611 in test_undecodable_code() of test_sys
Write test.support.workaroundIssue8611() function so it will be easier to
remove this workaround from all tests.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 4ab6593..6ce0d5f 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1175,15 +1175,12 @@ class FSEncodingTests(unittest.TestCase): self.assertEqual(decoded, repr(unicodefn)) check('utf-8', b'\xc3\xa9\x80', '\xe9\udc80') - try: - sys.executable.encode("ascii") - except UnicodeEncodeError: - # Python doesn't start with ASCII locale if its path is not ASCII, - # see issue #8611 - pass - else: - check('ascii', b'abc\xff', 'abc\udcff') - check('iso-8859-15', b'\xef\xa4', '\xef\u20ac') + + # Raise SkipTest() if sys.executable is not encodable to ascii + support.workaroundIssue8611() + + check('ascii', b'abc\xff', 'abc\udcff') + check('iso-8859-15', b'\xef\xa4', '\xef\u20ac') def test_main(): |