Repository navigation
Closed
Closed
Copy link
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2019-08-14.20:14:54.883>
labels = ['3.7', '3.8', 'type-bug', 'library', '3.9']
title = 'CookieLib: MozillaCookieJar.py uses case-sensitive regex to validate cookies file'
updated_at = <Date 2019-09-04.21:02:38.953>
user = 'https://github.com/ashleyharvey'bugs.python.org fields:
activity = <Date 2019-09-04.21:02:38.953>
actor = 'ned.deily'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2019-08-14.20:14:54.883>
creator = 'ashleyharvey'
dependencies = []
files = []
hgrepos = []
issue_num = 37858
keywords = ['patch']
message_count = 2.0
messages = ['349743', '349744']
nosy_count = 1.0
nosy_names = ['ashleyharvey']
pr_nums = ['15673', '15679', '15680']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue37858'
versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']Linked PRs
- [3.15] gh-82039: Relax cookiejar.py case-sensitive regex for the inconsequential first line of the cookie file (GH-15673) #155580
- [3.14] gh-82039: Relax cookiejar.py case-sensitive regex for the inconsequential first line of the cookie file (GH-15673) #155581
- [3.13] gh-82039: Relax cookiejar.py case-sensitive regex for the inconsequential first line of the cookie file (GH-15673) #155582
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
ashleyharvey commentedon Aug 14, 2019
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.
ned-deily commentedon Aug 14, 2019
(removing the macOS component since presumably this behavior is not platform-dependent)
gh-82039: Relax cookiejar.py case-sensitive regex for the inconsequen…
[3.13] gh-82039: Relax cookiejar.py case-sensitive regex for the inco…
[3.14] gh-82039: Relax cookiejar.py case-sensitive regex for the inco…
pythongh-82039: Relax cookiejar.py case-sensitive regex for the incon…
[3.15] gh-82039: Relax cookiejar.py case-sensitive regex for the inco…