summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-19 11:17:12 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-19 11:17:12 (GMT)
commit70f88c59eb285f85b8d16b88a75aeeb6b6a2b9ab (patch)
treef8bcc2e61982a539c1b185b8e7ba6e489491876d /Lib/test
parent5ea823cf55911c03b196f1bf45de4c9a2474a903 (diff)
downloadcpython-70f88c59eb285f85b8d16b88a75aeeb6b6a2b9ab.zip
cpython-70f88c59eb285f85b8d16b88a75aeeb6b6a2b9ab.tar.gz
cpython-70f88c59eb285f85b8d16b88a75aeeb6b6a2b9ab.tar.bz2
Fix test_os: workaround #8611 bug
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index cd8a1b9..4910b1e 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1165,9 +1165,16 @@ class FSEncodingTests(unittest.TestCase):
decoded = self.get_output(encoding, 'repr(os.fsdecode(%a))' % bytesfn)
self.assertEqual(decoded, repr(unicodefn))
- check('ascii', b'abc\xff', 'abc\udcff')
check('utf-8', b'\xc3\xa9\x80', '\xe9\udc80')
- check('iso-8859-15', b'\xef\xa4', '\xef\u20ac')
+ 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')
def test_main():