Kaydet (Commit) d76bd697 authored tarafından Georg Brandl's avatar Georg Brandl

Cookie.py shouldn't "bogusly" use string._idmap.

üst 7a1af770
...@@ -304,9 +304,11 @@ _Translator = { ...@@ -304,9 +304,11 @@ _Translator = {
'\372' : '\\372', '\373' : '\\373', '\374' : '\\374', '\372' : '\\372', '\373' : '\\373', '\374' : '\\374',
'\375' : '\\375', '\376' : '\\376', '\377' : '\\377' '\375' : '\\375', '\376' : '\\376', '\377' : '\\377'
} }
_idmap = ''.join(chr(x) for x in xrange(256))
def _quote(str, LegalChars=_LegalChars, 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, # If the string does not need to be double-quoted,
# then just return the string. Otherwise, surround # then just return the string. Otherwise, surround
...@@ -440,7 +442,7 @@ class Morsel(dict): ...@@ -440,7 +442,7 @@ class Morsel(dict):
def set(self, key, val, coded_val, def set(self, key, val, coded_val,
LegalChars=_LegalChars, LegalChars=_LegalChars,
idmap=string._idmap, translate=string.translate ): idmap=_idmap, translate=string.translate):
# First we verify that the key isn't a reserved word # First we verify that the key isn't a reserved word
# Second we make sure it only contains legal characters # Second we make sure it only contains legal characters
if key.lower() in self._reserved: if key.lower() in self._reserved:
......
...@@ -35,7 +35,6 @@ printable = digits + letters + punctuation + whitespace ...@@ -35,7 +35,6 @@ printable = digits + letters + punctuation + whitespace
# Case conversion helpers # Case conversion helpers
# Use str to convert Unicode literal in case of -U # Use str to convert Unicode literal in case of -U
# Note that Cookie.py bogusly uses _idmap :(
l = map(chr, xrange(256)) l = map(chr, xrange(256))
_idmap = str('').join(l) _idmap = str('').join(l)
del l del l
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment