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.

Author paulie4
Recipients paulie4
Date 2020-11-03.19:17:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604431041.17.0.875441243707.issue42256@roundup.psfhosted.org>
In-reply-to
Content
Since `requests` creates a comma-separated list for any duplicated headers, this causes a problem when `expires=...` is between two `Set-Cookie` header values. `BaseCookie.__parse_string()` in https://github.com/python/cpython/blob/master/Lib/http/cookies.py, in that case, will just give up, since it thinks it was given an invalid cookie. The fix is to replace the comma at the end of each trailing `expires=...` with a semicolon. Inside `BaseCookie.__parse_string()`, before the `while` loop, all that should be needed is to add this:
```
str = re.sub('(=\w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT),', r'\1;', str)
```
History
Date User Action Args
2020-11-03 19:17:21paulie4setrecipients: + paulie4
2020-11-03 19:17:21paulie4setmessageid: <1604431041.17.0.875441243707.issue42256@roundup.psfhosted.org>
2020-11-03 19:17:21paulie4linkissue42256 messages
2020-11-03 19:17:20paulie4create