[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-05-02 Thread daniel hahler
daniel hahler added the comment: I seems like http.cookiejar should be used for clients, which includes more relaxed parsing of cookies. This is mentioned in the docs at https://github.com/python/cpython/blame/443fe5a52a3d6a101795380227ced38b4b5e0a8b/Doc/library/http.cookies.rst#L63-L65.

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-25 Thread Martin Panter
Martin Panter added the comment: Test_http_cookies line 19 has the following test case: {'data': 'keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"', 'dict': {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'}, 'repr': '', 'output': 'Set-Cookie: keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"'} This

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-23 Thread SilentGhost
Change by SilentGhost : -- nosy: +martin.panter, xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-22 Thread MeiK
MeiK added the comment: I found that using http.cookiejar.parse_ns_headers would cause some of the previous tests to fail, and if you think this method is workable, I can follow it to write a new one and pass all the tests. -- nosy: -martin.panter, xtreak

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-22 Thread MeiK
MeiK added the comment: You are right, I saw the agreed way of parsing in RFC6265[1], it seems that you should not use regular expressions. I used http.cookiejar to update the code, but it failed to pass the test:

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-22 Thread daniel hahler
daniel hahler added the comment: http.cookiejar parses this correctly, using http2time: >>> import http.cookiejar >>> http.cookiejar.parse_ns_headers(["has_recent_activity=1; path=/; expires=Mon, 22 Apr 2019 23:27:18 -"]) [[('has_recent_activity', '1'), ('path', '/'),

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-22 Thread daniel hahler
daniel hahler added the comment: Another example of a value that fails to parse is if "-" is used instead of "GMT", which is the case with GitHub: > Set-Cookie: has_recent_activity=1; path=/; expires=Mon, 22 Apr 2019 23:27:18 > - So using a regular expression here to only parse the

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-01-26 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Yes, sorry I thought it was the format used for parsing too. Thanks for the example Martin. I am linking @MeiK PR to the issue where I asked them to open an issue for this. -- keywords: +patch pull_requests: +11517 stage: -> patch review

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-01-26 Thread Martin Panter
Martin Panter added the comment: I presume MeiK wants to use BaseCookie to parse the Set-Cookie header field, as in >>> BaseCookie('Hello=World; Expires=Thu, 31 Jan 2019 05:56:00 GMT;') >>> BaseCookie('Hello=World; Expires=Thu,31 Jan 2019 05:56:00 GMT;') Karthikeyan, if you meant the

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-01-24 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the MDN cookie directive link. I didn't know it links to Date link in the GitHub PR. I don't see space optional in the sane-date format specified for expires attribute. I could be reading the grammar wrong. I will wait for others

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-01-24 Thread MeiK
New submission from MeiK : http.cookies.BaseCookie[1] can't parse Expires in this format like Expires=Thu,31 Jan 2019 05:56:00 GMT;(Less space after Thu,). I encountered this problem in actual use, Chrome, IE and Firefox can parse this string normally. Many languages, such as JavaScript, can

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-01-24 Thread MeiK
Change by MeiK : -- components: Extension Modules nosy: MeiK priority: normal severity: normal status: open title: http.cookies._CookiePattern modifying regular expressions type: enhancement ___ Python tracker