summaryrefslogtreecommitdiff
path: root/Lib/test/test_xmlrpc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-01 15:23:43 +0000
committerGeorg Brandl <georg@python.org>2009-04-01 15:23:43 +0000
commit61fce3877cd11508f43b4d4e71276b03c3ef2823 (patch)
treeccbc8caf671628f86bf0997dfd99543da5efabd3 /Lib/test/test_xmlrpc.py
parentc53306c21734e90a6bf2f6676eb9f0c9486548a4 (diff)
downloadcpython-git-61fce3877cd11508f43b4d4e71276b03c3ef2823.tar.gz
Fix test_xmlrpc and make the CGI handler work with no CONTENT_LENGTH.
Diffstat (limited to 'Lib/test/test_xmlrpc.py')
-rw-r--r--Lib/test/test_xmlrpc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 05154cc5b5..4f057c78a3 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -629,7 +629,11 @@ class CGIHandlerTestCase(unittest.TestCase):
sys.stdin = open("xmldata.txt", "r")
sys.stdout = open(test_support.TESTFN, "w")
- self.cgi.handle_request()
+ os.environ['CONTENT_LENGTH'] = str(len(data))
+ try:
+ self.cgi.handle_request()
+ finally:
+ del os.environ['CONTENT_LENGTH']
sys.stdin.close()
sys.stdout.close()