This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: MozillaCookieJar should not store leading whitespace in Magic header
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: aantony, georg.brandl, terry.reedy
Priority: normal Keywords: easy

Created on 2009-02-03 21:23 by aantony, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
5147.diff aantony, 2010-06-26 01:10 patch
Messages (4)
msg81100 - (view) Author: Ajith Antony (aantony) Date: 2009-02-03 21:23
It seems that in the MozillaCookieJar library, the author accidently 
indented
the long string that represents the magic header of the Netscape 
compatible
cookie file.  This is not a problem for MozillaCookieJar as the regex to 
test
the magic header is not bound to the beginning of the line.

Other libraries, however, may bind the pattern match to the beginning of 
the
line, such as perl's HTTP::Cookies::Netscape.

For better compatibility of Netscape cookies files, the magic header 
must not
be indented.


Index: svn-python-lib/_MozillaCookieJar.py
===================================================================
--- svn-python-lib/_MozillaCookieJar.py (revision 69261)
+++ svn-python-lib/_MozillaCookieJar.py (working copy)
@@ -38,9 +38,9 @@
     """
     magic_re = "#( Netscape)? HTTP Cookie File"
     header = """\
-    # Netscape HTTP Cookie File
-    # http://www.netscape.com/newsref/std/cookie_spec.html
-    # This is a generated file!  Do not edit.
+# Netscape HTTP Cookie File
+# http://www.netscape.com/newsref/std/cookie_spec.html
+# This is a generated file!  Do not edit.

 """
msg108659 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-06-26 00:15
To apply this patch, it needs to be uploaded as a file xxx.dif.

Removing the idents looks correct even if trivial.
msg108671 - (view) Author: Ajith Antony (aantony) Date: 2010-06-26 01:10
ok. Patch attached.  I think.
msg112218 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-31 22:11
Applied in r83373. Thanks!
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49397
2010-07-31 22:11:48georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg112218

resolution: fixed
2010-06-26 01:10:26aantonysetfiles: + 5147.diff

messages: + msg108671
2010-06-26 00:15:31terry.reedysetversions: + Python 3.2, - Python 2.5, Python 2.4, Python 3.0
nosy: + terry.reedy

messages: + msg108659

keywords: + easy
2009-02-03 21:23:59aantonycreate