[Python-checkins] python/dist/src/Lib _LWPCookieJar.py, 1.2, 1.3 _MozillaCookieJar.py, 1.3, 1.4 cookielib.py, 1.8, 1.9

loewis at users.sourceforge.net loewis at users.sourceforge.net
Thu Mar 3 11:57:39 CET 2005


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6257/Lib

Modified Files:
	_LWPCookieJar.py _MozillaCookieJar.py cookielib.py 
Log Message:
Patch #1117454: Remove code to special-case cookies without values
in LWPCookieJar. Backported to 2.4.


Index: _LWPCookieJar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_LWPCookieJar.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- _LWPCookieJar.py	31 Aug 2004 11:38:12 -0000	1.2
+++ _LWPCookieJar.py	3 Mar 2005 10:57:36 -0000	1.3
@@ -115,13 +115,6 @@
 
                 for data in split_header_words([line]):
                     name, value = data[0]
-                    # name and value are an exception here, since a plain "foo"
-                    # (with no "=", unlike "bar=foo") means a cookie with no
-                    # name and value "foo".  With all other cookie-attributes,
-                    # the situation is reversed: "foo" means an attribute named
-                    # "foo" with no value!
-                    if value is None:
-                        name, value = value, name
                     standard = {}
                     rest = {}
                     for k in boolean_attrs:

Index: _MozillaCookieJar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_MozillaCookieJar.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- _MozillaCookieJar.py	1 Sep 2004 13:10:31 -0000	1.3
+++ _MozillaCookieJar.py	3 Mar 2005 10:57:36 -0000	1.4
@@ -73,6 +73,9 @@
                 secure = (secure == "TRUE")
                 domain_specified = (domain_specified == "TRUE")
                 if name == "":
+                    # cookies.txt regards 'Set-Cookie: foo' as a cookie
+                    # with no name, whereas cookielib regards it as a
+                    # cookie with no value.
                     name = value
                     value = None
 

Index: cookielib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/cookielib.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cookielib.py	3 Mar 2005 10:48:12 -0000	1.8
+++ cookielib.py	3 Mar 2005 10:57:36 -0000	1.9
@@ -451,11 +451,7 @@
             param = param.rstrip()
             if param == "": continue
             if "=" not in param:
-                if param.lower() in known_attrs:
-                    k, v = param, None
-                else:
-                    # cookie with missing value
-                    k, v = param, None
+                k, v = param, None
             else:
                 k, v = re.split(r"\s*=\s*", param, 1)
                 k = k.lstrip()



More information about the Python-checkins mailing list