]> granicus.if.org Git - python/commitdiff
Make Tim O'Malley's requested change: in FieldStorage.__init__(), when
authorGuido van Rossum <guido@python.org>
Fri, 8 May 1998 19:55:51 +0000 (19:55 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 8 May 1998 19:55:51 +0000 (19:55 +0000)
method='GET', always get the query string from environ['QUERY_STRING']
or sys.argv[1] -- ignore an explicitly passed in fp.

Lib/cgi.py

index e3842e6aafd27f594031f7c9c28c6f170afe28fe..97ecbbbbc661ca1440f76e82148cd7083f3d27e7 100755 (executable)
@@ -763,6 +763,7 @@ class FieldStorage:
         Arguments, all optional:
 
         fp              : file pointer; default: sys.stdin
+            (not used when the request method is GET)
 
         headers         : header dictionary-like object; default:
             taken from environ as per CGI spec
@@ -789,7 +790,7 @@ class FieldStorage:
         self.strict_parsing = strict_parsing
         if environ.has_key('REQUEST_METHOD'):
             method = string.upper(environ['REQUEST_METHOD'])
-        if not fp and method == 'GET':
+        if method == 'GET':
             if environ.has_key('QUERY_STRING'):
                 qs = environ['QUERY_STRING']
             elif sys.argv[1:]: