From: Georg Brandl Date: Mon, 14 Aug 2006 22:01:24 +0000 (+0000) Subject: Cookie.py shouldn't "bogusly" use string._idmap. X-Git-Tag: v2.5c1~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d76bd69712e04d496e88f878f13876ce9c1765b0;p=python Cookie.py shouldn't "bogusly" use string._idmap. --- diff --git a/Lib/Cookie.py b/Lib/Cookie.py index 20a2941814..33bc4c0396 100644 --- a/Lib/Cookie.py +++ b/Lib/Cookie.py @@ -304,9 +304,11 @@ _Translator = { '\372' : '\\372', '\373' : '\\373', '\374' : '\\374', '\375' : '\\375', '\376' : '\\376', '\377' : '\\377' } + +_idmap = ''.join(chr(x) for x in xrange(256)) def _quote(str, LegalChars=_LegalChars, - idmap=string._idmap, translate=string.translate): + idmap=_idmap, translate=string.translate): # # If the string does not need to be double-quoted, # then just return the string. Otherwise, surround @@ -440,7 +442,7 @@ class Morsel(dict): def set(self, key, val, coded_val, LegalChars=_LegalChars, - idmap=string._idmap, translate=string.translate ): + idmap=_idmap, translate=string.translate): # First we verify that the key isn't a reserved word # Second we make sure it only contains legal characters if key.lower() in self._reserved: diff --git a/Lib/string.py b/Lib/string.py index a5837e94b8..921bd8b1d0 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -35,7 +35,6 @@ printable = digits + letters + punctuation + whitespace # Case conversion helpers # Use str to convert Unicode literal in case of -U -# Note that Cookie.py bogusly uses _idmap :( l = map(chr, xrange(256)) _idmap = str('').join(l) del l