classification
Title: Cookie.py does not correctly quote Morsels
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ajaksu2, berker.peksag, zdobersek, zenzen
Priority: normal Keywords: patch

Created on 2004-07-15 00:17 by zenzen, last changed 2016-04-25 12:04 by berker.peksag.

Files
File name Uploaded Description Edit
991266test.patch zdobersek, 2009-02-14 17:14 Patch to test_cookie.py review
991266fix.patch zdobersek, 2009-02-18 14:40 Fix - properly quote cookie's comment review
issue991266.diff berker.peksag, 2016-04-25 12:04 review
Messages (7)
msg60528 - (view) Author: Stuart Bishop (zenzen) Date: 2004-07-15 00:17
The quoting works fine for cookie values, but doesn't kick in for 
attributes like Comment. 

>>> c = SimpleCookie()
>>> c['foo'] = u'\N{COPYRIGHT SIGN}'.encode('UTF8')
>>> print str(c)
Set-Cookie: foo="\302\251";
>>> c['foo']['comment'] = u'\N{BIOHAZARD SIGN}'.encode('UTF8')
>>> print str(c)
Set-Cookie: foo="\302\251"; Comment=?;
>>> str(c)
'Set-Cookie: foo="\\302\\251"; Comment=\xe2\x98\xa3;'
>>> 
msg82094 - (view) Author: Zan Dobersek (zdobersek) Date: 2009-02-14 17:14
This patch adds an unicode character, converted to UTF8 as a cookie's
comment and then checks if it is correctly quoted.
msg82418 - (view) Author: Zan Dobersek (zdobersek) Date: 2009-02-18 14:40
This patch properly quotes cookie's comment and successfully passes
test_cookie.py with applied patch.
msg82420 - (view) Author: Daniel Diniz (ajaksu2) Date: 2009-02-18 15:07
Thanks, Zan!

All tests pass with both patches applied. Test and fix look correct to me.
msg110392 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-15 22:17
Can someone please take a look at this Cookie.py two line patch.
msg114367 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-19 15:12
Can we have this committed please, msg82420 says the patches are ok.
msg264172 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-25 12:04
Here is a patch for Python 3.
History
Date User Action Args
2016-04-25 12:04:56berker.peksagsetfiles: + issue991266.diff
versions: + Python 3.5, Python 3.6, - Python 3.1, Python 3.2
nosy: + berker.peksag

messages: + msg264172
2014-02-03 19:49:29BreamoreBoysetnosy: - BreamoreBoy
2010-08-19 15:12:27BreamoreBoysetmessages: + msg114367
2010-07-15 22:17:56BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2010-07-15 22:17:00BreamoreBoysetnosy: + BreamoreBoy
messages: + msg110392
2009-02-18 15:07:02ajaksu2setnosy: + ajaksu2
messages: + msg82420
stage: test needed -> patch review
2009-02-18 14:40:15zdoberseksetfiles: + 991266fix.patch
messages: + msg82418
2009-02-14 17:14:14zdoberseksetfiles: + 991266test.patch
keywords: + patch
messages: + msg82094
nosy: + zdobersek
2009-02-13 21:13:09jjleesetnosy: - jjlee
2009-02-13 01:18:53ajaksu2setnosy: + jjlee
stage: test needed
type: behavior
versions: + Python 2.6, - Python 2.3
2004-07-15 00:17:04zenzencreate