[New-bugs-announce] [issue37858] CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file

Ashley Harvey report at bugs.python.org
Wed Aug 14 16:14:54 EDT 2019


New submission from Ashley Harvey <machone at gmail.com>:

I'm on macOS 10.14.6, wget 1.20.3, python 2.7.

Command line:
$ wget --save-cookies cookies.txt --keep-session-cookies --post-data
'username=myUserName&password=myPassword' --delete-after <url>

Line 39 of _MozillaCookieJar.py (cookielib) shows it looking for 'magic_re = "#( Netscape)? HTTP Cookie File"' in order to validate the supplied cookies file.  Unlike cURL, wget however, produces a cookies file that begins with "# HTTP cookie file".  Note the lower-case c and f.  I reported this as a bug to the wget team who looked for the spec to say that that line must follow a certain format and couldn't find any such mention.  (See: https://savannah.gnu.org/bugs/?56755)

The lack of upper-case c and f cause cookielib to choke and stop processing
the cookies file, and so here I am reporting it as a bug that the regex is case-sensitive.

----------
components: Library (Lib), macOS
messages: 349743
nosy: ashleyharvey, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37858>
_______________________________________


More information about the New-bugs-announce mailing list