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 alb_moral
Recipients alb_moral
Date 2018-10-10.08:05:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539158741.03.0.788709270274.issue34951@psf.upfronthosting.co.za>
In-reply-to
Content
http.cookiejar (cookielib, for python2.*) does not parse some cookies' Expires date.

For  example: "Friday, 1-August-1997 00:00:00 GMT" does not work (while: "Fri, 01 Aug 1997 00:00:00 GMT" works fine)

This is basically due to long names of months (it is compared with MONTHS_LOWER: list of 3-letter months). So, I propose a small change in the definition of LOOSE_HTTP_DATE_RE (see fifth line):

LOOSE_HTTP_DATE_RE = re.compile(
    r"""^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w{3})\w*         # month (3 first letters only)
    ...

Instead of:
LOOSE_HTTP_DATE_RE = re.compile(
    r"""^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w+)              # month
    ...

I've tested only http.cookiejar (python 3.6), but I suposse the same change will work on cookielib

Thanks in advance
History
Date User Action Args
2018-10-10 08:05:41alb_moralsetrecipients: + alb_moral
2018-10-10 08:05:41alb_moralsetmessageid: <1539158741.03.0.788709270274.issue34951@psf.upfronthosting.co.za>
2018-10-10 08:05:41alb_morallinkissue34951 messages
2018-10-10 08:05:40alb_moralcreate