[Python-checkins] r84200 - python/branches/py3k/Lib/test/test_os.py

victor.stinner python-checkins at python.org
Thu Aug 19 13:17:12 CEST 2010


Author: victor.stinner
Date: Thu Aug 19 13:17:12 2010
New Revision: 84200

Log:
Fix test_os: workaround #8611 bug


Modified:
   python/branches/py3k/Lib/test/test_os.py

Modified: python/branches/py3k/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k/Lib/test/test_os.py	(original)
+++ python/branches/py3k/Lib/test/test_os.py	Thu Aug 19 13:17:12 2010
@@ -1165,9 +1165,16 @@
             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():


More information about the Python-checkins mailing list