diff options
author | Georg Brandl <georg@python.org> | 2009-04-01 15:23:43 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-01 15:23:43 +0000 |
commit | 61fce3877cd11508f43b4d4e71276b03c3ef2823 (patch) | |
tree | ccbc8caf671628f86bf0997dfd99543da5efabd3 /Lib/test/test_xmlrpc.py | |
parent | c53306c21734e90a6bf2f6676eb9f0c9486548a4 (diff) | |
download | cpython-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.py | 6 |
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() |