[Python-checkins] r70940 - in python/trunk: Lib/SimpleXMLRPCServer.py Misc/NEWS

georg.brandl python-checkins at python.org
Wed Apr 1 06:21:14 CEST 2009


Author: georg.brandl
Date: Wed Apr  1 06:21:14 2009
New Revision: 70940

Log:
The SimpleXMLRPCServer's CGI handler now runs like a pony.


Modified:
   python/trunk/Lib/SimpleXMLRPCServer.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/SimpleXMLRPCServer.py
==============================================================================
--- python/trunk/Lib/SimpleXMLRPCServer.py	(original)
+++ python/trunk/Lib/SimpleXMLRPCServer.py	Wed Apr  1 06:21:14 2009
@@ -598,8 +598,12 @@
             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)
 

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Wed Apr  1 06:21:14 2009
@@ -200,6 +200,8 @@
 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.


More information about the Python-checkins mailing list