summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-17 19:57:40 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-17 19:57:40 (GMT)
commitc0983856c6814272a5e6004bd50b429afba3f3b4 (patch)
treee5e9268804ffb29e1b21a863c4cb6ff9b05cedc8
parent1465cc2887be2054cca50c72ef804adcc15fdf65 (diff)
downloadcpython-c0983856c6814272a5e6004bd50b429afba3f3b4.zip
cpython-c0983856c6814272a5e6004bd50b429afba3f3b4.tar.gz
cpython-c0983856c6814272a5e6004bd50b429afba3f3b4.tar.bz2
Fix test_main_invalid_unicode() of test_sys for ASCII locale encoding
It should fix sparc 3.x and 3.1 failures.
-rw-r--r--Lib/test/test_sys.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index a1b5ee7..4fb1d36 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -152,7 +152,7 @@ class SysModuleTest(unittest.TestCase):
stdout, stderr = process.communicate()
self.assertEqual(process.returncode, 1)
self.assertTrue(stderr.startswith(expected),
- "%r doesn't start with %r" % (stderr, expected))
+ "%s doesn't start with %s" % (ascii(stderr), ascii(expected)))
# test that stderr buffer if flushed before the exit message is written
# into stderr
@@ -485,9 +485,8 @@ class SysModuleTest(unittest.TestCase):
p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
self.assertEqual(p.returncode, 1)
- self.assert_(stderr.startswith(b"UnicodeEncodeError: "
- b"'utf-8' codec can't encode character '\\udcff' in "
- b"position 7: surrogates not allowed"), stderr)
+ self.assert_(b"UnicodeEncodeError:" in stderr,
+ "%r not in %s" % (b"UniodeEncodeError:", ascii(stderr)))
def test_sys_flags(self):
self.assertTrue(sys.flags)