STINNER Victor <victor.stin...@haypocalc.com> added the comment:

SimpleXMLRPCRequestHandler.do_POST() writes the traceback in the HTTP header 
"X-traceback". But an HTTP header value is ASCII only, whereas a traceback can 
contain any character (eg. an non-ASCII character from a directory name for 
this issue).

A simple fix would be to use the ASCII charset with the backslashreplace error 
handler. Attached patch uses:

   trace = str(trace.encode('ASCII', 'backslashreplace'), 'ASCII')

Is there an easier method to escape non-ASCII characters without double 
conversion (unicode->bytes and bytes->unicode)?

----------
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file15958/xmlrpc_server_ascii_traceback.patch

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

Reply via email to