Issue 5147: MozillaCookieJar should not store leading whitespace in Magic header (original) (raw)

Issue5147

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:45 admin set github: 49397
2010-07-31 22:11:48 georg.brandl set status: open -> closednosy: + georg.brandlmessages: + resolution: fixed
2010-06-26 01:10:26 aantony set files: + 5147.diffmessages: +
2010-06-26 00:15:31 terry.reedy set versions: + Python 3.2, - Python 2.5, Python 2.4, Python 3.0nosy: + terry.reedymessages: + keywords: + easy
2009-02-03 21:23:59 aantony create