[Tracker-discuss] [issue667] cookielib/cookiejar cookies' expire date parse

2018-10-10 Thread Ezio Melotti


Ezio Melotti  added the comment:

No problem, thanks for taking the time to report the issue.

___
PSF Meta Tracker 

___
___
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/


[Tracker-discuss] [issue667] cookielib/cookiejar cookies' expire date parse

2018-10-10 Thread Alberto Moral


Alberto Moral  added the comment:

Thanks, Ezio

I've reported it on https://bugs.python.org/

Sorry for the mistake... I'm a newbie in these matters :)

___
PSF Meta Tracker 

___
___
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/


[Tracker-discuss] [issue667] cookielib/cookiejar cookies' expire date parse

2018-10-09 Thread Ezio Melotti


Ezio Melotti  added the comment:

The correct place where to report this is https://bugs.python.org/
See also https://devguide.python.org/tracker/#reporting-an-issue for more 
information.

--
assignedto:  -> ezio.melotti
nosy: +ezio.melotti
status: chatting -> resolved

___
PSF Meta Tracker 

___
___
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/


[Tracker-discuss] [issue667] cookielib/cookiejar cookies' expire date parse

2018-10-08 Thread Alberto Moral


New submission from Alberto Moral :

http.cookiejar (cookielib, for python2.*) does not parse some cookies' expire 
date. For  example: "Friday, 1-August-1997 00:00:00 GMT" (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 re LOOSE_HTTP_DATE_RE:

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

PD. This is a SECOND VERSION of this issue (I've fixed and removed it). Sorry

___
PSF Meta Tracker 

___
___
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/


[Tracker-discuss] [issue667] cookielib/cookiejar cookies' expire date parse

2018-10-08 Thread Alberto Moral


New submission from Alberto Moral :

http.cookiejar (cookielib, python2.*) does not parse some cookies' expire date. 
For  example: "Friday, 1-August-1997 00:00:00 GMT" (while: "Fri, 1-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 re's STRICT_DATE_RE and LOOSE_HTTP_DATE_RE:

STRICT_DATE_RE = re.compile(
r"^[SMTWF][a-z][a-z]+, (\d\d) ([JFMASOND][a-z][a-z])[a-z]+ "
r"(\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$", re.ASCII)

Instead of:

STRICT_DATE_RE = re.compile(
r"^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) "
r"(\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$", re.ASCII)


And:

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

--
messages: 3546
nosy: alb_moral
priority: bug
status: unread
title: cookielib/cookiejar cookies' expire date parse

___
PSF Meta Tracker 

___
___
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/