summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-17 20:01:55 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-17 20:01:55 (GMT)
commit0cfc9f65ef6ee9511ad1e1f5778f8150c7eac347 (patch)
treeb233c0d4964277c2a6199958e94bdf68ad516a55 /Lib/test/test_sys.py
parent3a5d703045ebfebf45fdc1a26ac4c230c4773c45 (diff)
downloadcpython-0cfc9f65ef6ee9511ad1e1f5778f8150c7eac347.zip
cpython-0cfc9f65ef6ee9511ad1e1f5778f8150c7eac347.tar.gz
cpython-0cfc9f65ef6ee9511ad1e1f5778f8150c7eac347.tar.bz2
Merged revisions 81276 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81276 | victor.stinner | 2010-05-17 21:57:40 +0200 (lun., 17 mai 2010) | 4 lines Fix test_main_invalid_unicode() of test_sys for ASCII locale encoding It should fix sparc 3.x and 3.1 failures. ........
Diffstat (limited to 'Lib/test/test_sys.py')
-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 903ad91..4beb429 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -145,7 +145,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
@@ -439,9 +439,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)