summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2015-03-29 21:09:21 (GMT)
committerR David Murray <rdmurray@bitdance.com>2015-03-29 21:09:21 (GMT)
commit1813c1701f8e7e9287bccf66d1b4b8348c432168 (patch)
tree07d91a6490d90cdfbd84618daf79354c831343bd /Lib/http
parent0deefd5a9402e3bd13ed899f9b939062faf98114 (diff)
downloadcpython-1813c1701f8e7e9287bccf66d1b4b8348c432168.zip
cpython-1813c1701f8e7e9287bccf66d1b4b8348c432168.tar.gz
cpython-1813c1701f8e7e9287bccf66d1b4b8348c432168.tar.bz2
#2211: properly document the Morsel behavior changes.
Also deprecate the undocumented set argument instead of removing it already in 3.5. Initial patch by Demian Brecht.
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/cookies.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index 98489fb..26c9ac4 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -366,7 +366,14 @@ class Morsel(dict):
def isReservedKey(self, K):
return K.lower() in self._reserved
- def set(self, key, val, coded_val):
+ def set(self, key, val, coded_val, LegalChars=_LegalChars):
+ if LegalChars != _LegalChars:
+ import warnings
+ warnings.warn(
+ 'LegalChars parameter is deprecated, ignored and will '
+ 'be removed in future versions.', DeprecationWarning,
+ stacklevel=2)
+
if key.lower() in self._reserved:
raise CookieError('Attempt to set a reserved key %r' % (key,))
if not _is_legal_key(key):