New submission from Wolfgang Schnerring <wosc+pyt...@wosc.de>:

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).

----------
components: Library (Lib)
messages: 143680
nosy: wosc
priority: normal
severity: normal
status: open
title: xmlrpclib confuses unicode and string
type: behavior
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12931>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to