This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wosc
Recipients wosc
Date 2011-09-07.14:30:06
SpamBayes Score 9.43122e-08
Marked as misclassified No
Message-id <1315405807.49.0.456740277996.issue12931@psf.upfronthosting.co.za>
In-reply-to
Content
This is a similar issue to http://bugs.python.org/issue7093, but more insiduous:

This works:

xmlrpclib.ServerProxy(u'http://localhost:8080').foo(dict(baz=u'bär'))

While this fails with a UnicodeDecodeError (note the trailing slash in the URI):

xmlrpclib.ServerProxy(u'http://localhost:8080/').foo(dict(baz=u'bär'))

  File "/usr/local/python2.7/lib/python2.7/httplib.py", line 937, in endheaders
    self._send_output(message_body)
  File "/usr/local/python2.7/lib/python2.7/httplib.py", line 795, in _send_output
    msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 139: ordinal not in range(128)


So, somewhere in xmlrpclib, confusion happens, since even though the URI is passed in as unicode both times, it is stored as string in the first case (thus compatible with the serialized, utf-8 encoded string of the message body), but in the second case it remains unicode (thus failing, as #7093 tells, which I personally wouldn't have closed wontfix).
History
Date User Action Args
2011-09-07 14:30:07woscsetrecipients: + wosc
2011-09-07 14:30:07woscsetmessageid: <1315405807.49.0.456740277996.issue12931@psf.upfronthosting.co.za>
2011-09-07 14:30:06wosclinkissue12931 messages
2011-09-07 14:30:06wosccreate