[issue7606] test_xmlrpc fails with non-ascii path

Martin v. Löwis report at bugs.python.org
Wed Dec 30 23:03:06 CET 2009

Martin v. Löwis <martin at v.loewis.de> added the comment:

>     self.send_header("X-traceback", traceback.format_exc())

That's fairly tricky. send_header expects two strings (bytes are
not acceptable), and also requires these strings to be ASCII.
This is why it breaks: format_exc returns a non-ASCII string.

I see two options:
a) allow non-Unicode values for keyword and value in send_header,
   and have xmlrpc.server encode the header itself, or
b) properly MIME-encode value if it contains non-ASCII characters
   (keyword really must be ASCII, I think).

Not sure whether there is any precedence for UTF-8 in HTTP


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list