[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


Bar Harel  added the comment:

Patch done, ready for upload.
No http experts for nosy, triage needed.

--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


Bar Harel  added the comment:

For reference, docs already state:

"On encountering an invalid cookie, CookieError is raised, so if your cookie 
data comes from a browser you should always prepare for invalid data and catch 
CookieError on parsing."

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


Bar Harel  added the comment:

The only issue I fear is breakage if people count on it silently ignoring 
errors.
But then again it's inconsistent, and sometimes it will throw errors either 
way, so I still believe this issue should be addressed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


Change by Bar Harel :


--
pull_requests: +18412
pull_request: https://github.com/python/cpython/pull/19059

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40002] Cookie load error inconsistency

2020-03-18 Thread Aviram


Change by Aviram :


--
keywords: +patch
nosy: +aviramha
nosy_count: 1.0 -> 2.0
pull_requests: +18411
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19058

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


New submission from Bar Harel :

ATM loading cookies is inconsistent.
If you encounter an invalid cookie, BaseCookie.load will sometimes raise 
CookieError and sometimes silently ignore the load:
 
from http.cookies import SimpleCookie
s = SimpleCookie()
s.load("invalid\x00=cookie") # Silently ignored
s.load("invalid/=cookie") # Raises CookieError

--
components: Library (Lib)
messages: 364519
nosy: bar.harel
priority: normal
severity: normal
status: open
title: Cookie load error inconsistency
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com