[issue28378] urllib2 does not handle cookies with `,`

2016-10-12 Thread SilentGhost
SilentGhost added the comment: On python2 you should be able to use Cookie module to parse cookies, rather than doing that manually. Commas are handled correctly there. On python3 the same functionality can be found in http.cookies. The SimpleCookie.load could be used directly to have the

[issue28378] urllib2 does not handle cookies with `,`

2016-10-12 Thread Grzegorz Sikorski
Grzegorz Sikorski added the comment: I attach example express/nodejs server which by default returns a cookie with the comma (see expiry time format). The output from the python test file I posted in previous message is: ``` python test.py cookie1=exampleCookie; Path=/,

[issue28378] urllib2 does not handle cookies with `,`

2016-10-12 Thread Grzegorz Sikorski
Grzegorz Sikorski added the comment: I was debugging this and found out that urllib2 works more-less correct. The only problem I would see is referring to the header by `res.headers['Set-Cookie']`, as it returns comma-separated string, which cannot be processed properly in case the cookie

[issue28378] urllib2 does not handle cookies with `,`

2016-10-07 Thread SilentGhost
SilentGhost added the comment: Could you please post an example of what you're being sent from the server and how your code handles / fails to deal with it. -- nosy: +SilentGhost stage: -> test needed versions: +Python 2.7 ___ Python tracker

[issue28378] urllib2 does not handle cookies with `,`

2016-10-07 Thread Grzegorz Sikorski
Grzegorz Sikorski added the comment: It looks urllib2 works with this scenario, but upper level request fails. -- ___ Python tracker ___

[issue28378] urllib2 does not handle cookies with `,`

2016-10-06 Thread Grzegorz Sikorski
New submission from Grzegorz Sikorski: I have a usecase when the server sends two cookies in separate `Set-Cookie` headers. One of the cookie includes a `,` (comma). It seems this is not handled properly, as the library always try to fold multiple headers with the same name into a single