From: Georg Brandl Date: Wed, 1 Apr 2009 04:21:14 +0000 (+0000) Subject: The SimpleXMLRPCServer's CGI handler now runs like a pony. X-Git-Tag: v2.7a1~1645 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e92d4b6f57acd07ca48e842063146031e49eed15;p=python The SimpleXMLRPCServer's CGI handler now runs like a pony. --- diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py index 43757a03dd..4c286884a3 100644 --- a/Lib/SimpleXMLRPCServer.py +++ b/Lib/SimpleXMLRPCServer.py @@ -598,8 +598,12 @@ class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): self.handle_get() else: # POST data is normally available through stdin + try: + length = int(os.environ.get('CONTENT_LENGTH', None)) + except ValueError: + length = -1 if request_text is None: - request_text = sys.stdin.read() + request_text = sys.stdin.read(length) self.handle_xmlrpc(request_text) diff --git a/Misc/NEWS b/Misc/NEWS index d51a3601d2..1d210a1cd7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -200,6 +200,8 @@ Core and Builtins Library ------- +- Actually make the SimpleXMLRPCServer CGI handler work. + - Issue #2522: locale.format now checks its first argument to ensure it has been passed only one pattern, avoiding mysterious errors where it appeared that it was failing to do localization.