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 serhiy.storchaka
Recipients BreamoreBoy, Steven.Hartland, loewis, pitrou, serhiy.storchaka, vstinner
Date 2013-05-24.16:36:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Updating tests I found some related errors.

XML-RPC doesn't work in general case for non UTF-8 encoding:

>>> import xmlrpclib
>>> xmlrpclib.dumps(('\u20ac',), encoding='iso-8859-1')
>>> xmlrpclib.dumps((u'\u20ac',), encoding='iso-8859-1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/", line 1085, in dumps
    data = m.dumps(params)
  File "/usr/lib/python2.7/", line 632, in dumps
    dump(v, write)
  File "/usr/lib/python2.7/", line 654, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/", line 700, in dump_unicode
    value = value.encode(self.encoding)
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u20ac' in position 0: ordinal not in range(256)

We should use 'xmlcharrefreplace' error handler.

Non-ASCII strings is passed as Unicode strings (this should be documented).

>>> xmlrpclib.loads(xmlrpclib.dumps(('\xe2\x82\xac',)))
((u'\u20ac',), None)

'\r' and '\r\n' are deserialized as '\n'.

>>> xmlrpclib.loads(xmlrpclib.dumps(('\r',)))
(('\n',), None)
>>> xmlrpclib.loads(xmlrpclib.dumps(('\r\n',)))
(('\n',), None)
Date User Action Args
2013-05-24 16:36:45serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, pitrou, vstinner, Steven.Hartland, BreamoreBoy
2013-05-24 16:36:45serhiy.storchakasetmessageid: <>
2013-05-24 16:36:45serhiy.storchakalinkissue7727 messages
2013-05-24 16:36:45serhiy.storchakacreate