diff Lib/cgi.py @ 5302:5e3bcf4ebf29 legacy-trunk

From: Clarence Gardner <clarence@king.silcom.com> The function parse_qs currently calls urllib.unquote on the value of the field submitted, but not on the name. It needs to do both.
author Guido van Rossum <guido@python.org>
date Fri, 11 Apr 1997 18:20:42 +0000
parents bf1bd64f85e0
children b905372edd4f
line wrap: on
line diff
--- a/Lib/cgi.py	Fri Apr 11 17:19:54 1997 +0000
+++ b/Lib/cgi.py	Fri Apr 11 18:20:42 1997 +0000
@@ -412,7 +412,7 @@
 
 # " <== Emacs font-lock de-bogo-kludgificocity
 
-__version__ = "2.1"
+__version__ = "2.2"
 
 
 # Imports
@@ -556,7 +556,7 @@
 	    if strict_parsing:
 		raise ValueError, "bad query field: %s" % `name_value`
 	    continue
-	name = nv[0]
+	name = urllib.unquote(regsub.gsub('+', ' ', nv[0]))
 	value = urllib.unquote(regsub.gsub('+', ' ', nv[1]))
         if len(value) or keep_blank_values:
 	    if dict.has_key (name):