summaryrefslogtreecommitdiff
path: root/Lib/cgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index db10a6246c..e7cd778316 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -45,10 +45,10 @@ from warnings import filterwarnings, catch_warnings, warn
with catch_warnings():
if sys.py3kwarning:
filterwarnings("ignore", ".*mimetools has been removed",
- DeprecationWarning)
+ DeprecationWarning)
+ filterwarnings("ignore", ".*rfc822 has been removed",
+ DeprecationWarning)
import mimetools
- if sys.py3kwarning:
- filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
import rfc822
try:
@@ -132,7 +132,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
environ : environment dictionary; default: os.environ
keep_blank_values: flag indicating whether blank values in
- URL encoded forms should be treated as blank strings.
+ percent-encoded forms should be treated as blank strings.
A true value indicates that blanks should be retained as
blank strings. The default false value indicates that
blank values are to be ignored and treated as if they were
@@ -180,8 +180,8 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
"""Parse a query given as a string argument."""
- warn("cgi.parse_qs is deprecated, use urlparse.parse_qs \
- instead", PendingDeprecationWarning, 2)
+ warn("cgi.parse_qs is deprecated, use urlparse.parse_qs instead",
+ PendingDeprecationWarning, 2)
return urlparse.parse_qs(qs, keep_blank_values, strict_parsing)
@@ -293,7 +293,7 @@ def _parseparam(s):
while s[:1] == ';':
s = s[1:]
end = s.find(';')
- while end > 0 and s.count('"', 0, end) % 2:
+ while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
end = s.find(';', end + 1)
if end < 0:
end = len(s)
@@ -411,7 +411,7 @@ class FieldStorage:
environ : environment dictionary; default: os.environ
keep_blank_values: flag indicating whether blank values in
- URL encoded forms should be treated as blank strings.
+ percent-encoded forms should be treated as blank strings.
A true value indicates that blanks should be retained as
blank strings. The default false value indicates that
blank values are to be ignored and treated as if they were