Skip to content

Commit b1b4f94

Browse files
committed
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.
1 parent b9838d9 commit b1b4f94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/cgi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ def __init__(self, fp=None, headers=None, outerboundary="",
763763
Arguments, all optional:
764764
765765
fp : file pointer; default: sys.stdin
766+
(not used when the request method is GET)
766767
767768
headers : header dictionary-like object; default:
768769
taken from environ as per CGI spec
@@ -789,7 +790,7 @@ def __init__(self, fp=None, headers=None, outerboundary="",
789790
self.strict_parsing = strict_parsing
790791
if environ.has_key('REQUEST_METHOD'):
791792
method = string.upper(environ['REQUEST_METHOD'])
792-
if not fp and method == 'GET':
793+
if method == 'GET':
793794
if environ.has_key('QUERY_STRING'):
794795
qs = environ['QUERY_STRING']
795796
elif sys.argv[1:]:

0 commit comments

Comments
 (0)