summaryrefslogtreecommitdiffstats
path: root/Lib/cgi.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-08 19:55:51 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-08 19:55:51 (GMT)
commitb1b4f94527dd7c28f33c7d1ece0057b88e421d01 (patch)
tree54c0433e3c533c6497b6daa92043ef94569f5622 /Lib/cgi.py
parentb9838d97ada2fd64eae3e48eacf42341c9af6195 (diff)
downloadcpython-b1b4f94527dd7c28f33c7d1ece0057b88e421d01.zip
cpython-b1b4f94527dd7c28f33c7d1ece0057b88e421d01.tar.gz
cpython-b1b4f94527dd7c28f33c7d1ece0057b88e421d01.tar.bz2
Make Tim O'Malley's requested change: in FieldStorage.__init__(), when
method='GET', always get the query string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an explicitly passed in fp.
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index e3842e6..97ecbbb 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -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:]: