mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Issue #12931: xmlrpclib now encodes Unicode URI to ISO-8859-1, instead of
failing with a UnicodeDecodeError.
This commit is contained in:
parent
2156594d8c
commit
51b719814e
3 changed files with 9 additions and 0 deletions
|
|
@ -472,6 +472,9 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||||
# protocol error; provide additional information in test output
|
# protocol error; provide additional information in test output
|
||||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||||
|
|
||||||
|
def test_unicode_host(self):
|
||||||
|
server = xmlrpclib.ServerProxy(u"http://%s:%d/RPC2"%(ADDR, PORT))
|
||||||
|
self.assertEqual(server.add("a", u"\xe9"), u"a\xe9")
|
||||||
|
|
||||||
# [ch] The test 404 is causing lots of false alarms.
|
# [ch] The test 404 is causing lots of false alarms.
|
||||||
def XXXtest_404(self):
|
def XXXtest_404(self):
|
||||||
|
|
|
||||||
|
|
@ -1539,6 +1539,9 @@ class ServerProxy:
|
||||||
allow_none=0, use_datetime=0):
|
allow_none=0, use_datetime=0):
|
||||||
# establish a "logical" server connection
|
# establish a "logical" server connection
|
||||||
|
|
||||||
|
if isinstance(uri, unicode):
|
||||||
|
uri = uri.encode('ISO-8859-1')
|
||||||
|
|
||||||
# get the url
|
# get the url
|
||||||
import urllib
|
import urllib
|
||||||
type, uri = urllib.splittype(uri)
|
type, uri = urllib.splittype(uri)
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #12931: xmlrpclib now encodes Unicode URI to ISO-8859-1, instead of
|
||||||
|
failing with a UnicodeDecodeError.
|
||||||
|
|
||||||
- Issue #8933: distutils' PKG-INFO files will now correctly report
|
- Issue #8933: distutils' PKG-INFO files will now correctly report
|
||||||
Metadata-Version: 1.1 instead of 1.0 if a Classifier or Download-URL field is
|
Metadata-Version: 1.1 instead of 1.0 if a Classifier or Download-URL field is
|
||||||
present.
|
present.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue