diff options
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-x | Lib/cgi.py | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -420,7 +420,6 @@ import string import sys import os import urllib -import regsub import mimetools import rfc822 from StringIO import StringIO @@ -564,8 +563,8 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0): if strict_parsing: raise ValueError, "bad query field: %s" % `name_value` continue - name = urllib.unquote(regsub.gsub('+', ' ', nv[0])) - value = urllib.unquote(regsub.gsub('+', ' ', nv[1])) + name = urllib.unquote(string.replace(nv[0], '+', ' ')) + value = urllib.unquote(string.replace(nv[1], '+', ' ')) if len(value) or keep_blank_values: if dict.has_key (name): dict[name].append(value) @@ -1317,11 +1316,11 @@ environment as well. Here are some common variable names: def escape(s, quote=None): """Replace special characters '&', '<' and '>' by SGML entities.""" - s = regsub.gsub("&", "&", s) # Must be done first! - s = regsub.gsub("<", "<", s) - s = regsub.gsub(">", ">", s) + s = string.replace(s, "&", "&") # Must be done first! + s = string.replace(s, "<", "<") + s = string.replace(s, ">", ">",) if quote: - s = regsub.gsub('"', """, s) + s = string.replace(s, '"', """) return s |