diff options
author | Brett Cannon <bcannon@gmail.com> | 2007-07-29 02:57:38 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2007-07-29 02:57:38 (GMT) |
commit | 5de17db361d4cbf194c07b8ee5e037bb3bf3ae13 (patch) | |
tree | f73733279245793a2dd17ff44e31eb21a042da4e | |
parent | d38d078566c7aaf9c9f2cf65abc9bfe106187ba5 (diff) | |
download | cpython-5de17db361d4cbf194c07b8ee5e037bb3bf3ae13.zip cpython-5de17db361d4cbf194c07b8ee5e037bb3bf3ae13.tar.gz cpython-5de17db361d4cbf194c07b8ee5e037bb3bf3ae13.tar.bz2 |
Testing against a different default encoding is meaningless as the default
encoding can only be UTF-8 now.
-rw-r--r-- | Lib/test/test_xmlrpc.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index 0b8a963..75a439f 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -139,45 +139,6 @@ class XMLRPCTestCase(unittest.TestCase): xmlrpclib.loads(strg)[0][0]) self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,)) - def test_default_encoding_issues(self): - # SF bug #1115989: wrong decoding in '_stringify' - utf8 = """<?xml version='1.0' encoding='iso-8859-1'?> - <params> - <param><value> - <string>abc \x95</string> - </value></param> - <param><value> - <struct> - <member> - <name>def \x96</name> - <value><string>ghi \x97</string></value> - </member> - </struct> - </value></param> - </params> - """ - - # sys.setdefaultencoding() normally doesn't exist after site.py is - # loaded. Re-initializing sys again is the way to get it back. :-( - old_encoding = sys.getdefaultencoding() - setdefaultencoding_existed = hasattr(sys, "setdefaultencoding") - import imp - imp.init_builtin('sys') - sys.setdefaultencoding("iso-8859-1") - try: - (s, d), m = xmlrpclib.loads(utf8) - finally: - sys.setdefaultencoding(old_encoding) - if not setdefaultencoding_existed: - del sys.setdefaultencoding - - items = list(d.items()) - self.assertEquals(s, "abc \x95") - self.assert_(isinstance(s, str)) - self.assertEquals(items, [("def \x96", "ghi \x97")]) - self.assert_(isinstance(items[0][0], str)) - self.assert_(isinstance(items[0][1], str)) - class HelperTestCase(unittest.TestCase): def test_escape(self): |