diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-16 13:28:05 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-16 13:28:05 (GMT) |
commit | 5bfe1467f7611da791856da7231c86e2e76f598c (patch) | |
tree | 0952b418fdc896d2fccdfcfa37815607ff73495d /Lib/xmlrpc | |
parent | 876d7c84e6f59e99ae2a75e53fe9e7c1b97e518f (diff) | |
download | cpython-5bfe1467f7611da791856da7231c86e2e76f598c.zip cpython-5bfe1467f7611da791856da7231c86e2e76f598c.tar.gz cpython-5bfe1467f7611da791856da7231c86e2e76f598c.tar.bz2 |
Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
using backslashreplace error handler.
Diffstat (limited to 'Lib/xmlrpc')
-rw-r--r-- | Lib/xmlrpc/server.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py index 63df97f..eb231d3 100644 --- a/Lib/xmlrpc/server.py +++ b/Lib/xmlrpc/server.py @@ -499,7 +499,9 @@ class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler): if hasattr(self.server, '_send_traceback_header') and \ self.server._send_traceback_header: self.send_header("X-exception", str(e)) - self.send_header("X-traceback", traceback.format_exc()) + trace = traceback.format_exc() + trace = str(trace.encode('ASCII', 'backslashreplace'), 'ASCII') + self.send_header("X-traceback", trace) self.send_header("Content-length", "0") self.end_headers() |