[Python-checkins] r84223 - python/branches/py3k/Lib/test/test_sys.py

victor.stinner python-checkins at python.org
Fri Aug 20 13:08:18 CEST 2010


Author: victor.stinner
Date: Fri Aug 20 13:08:18 2010
New Revision: 84223

Log:
test_main_invalid_unicode() of test_sys: print string as ascii

There are buildbot failures on "x86 FreeBSD 3.x" and "sparc solaris10 gcc 3.x".
I suppose that _Py_char2wchar() doesn't fail even if the locale encoding is
unable to decode the byte string, because _Py_char2wchar() has a special mode
for platform without mbrtowc() (ISO C99) function.

Let's check my theory by avoid error on the Python print() instruction.


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

Modified: python/branches/py3k/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sys.py	(original)
+++ python/branches/py3k/Lib/test/test_sys.py	Fri Aug 20 13:08:18 2010
@@ -506,7 +506,7 @@
         else:
             self.skipTest('%r is decodable with encoding %s'
                 % (non_decodable, encoding))
-        code = b'print("' + non_decodable + b'")'
+        code = b'print(ascii("' + non_decodable + b'"))'
         p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE)
         stdout, stderr = p.communicate()
         self.assertEqual(p.returncode, 1)


More information about the Python-checkins mailing list