This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Williams
Recipients Mark.Williams, ajaksu2, alex, berker.peksag, zdobersek, zenzen
Date 2018-04-20.02:04:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524189859.86.0.682650639539.issue991266@psf.upfronthosting.co.za>
In-reply-to
Content
This patch only quotes the Comment attribute, and the rest of the code only quotes attributes if they're of the expected type.  Consider Expires:

>>> from http.cookies import SimpleCookie
>>> c = SimpleCookie()
>>> c['name'] = 'value'
>>> c['name']['comment'] = '\n'
>>> c['name']['expires'] = 123
>>> c.output()
'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT'
>>> c['name']['expires'] = '123; path=.example.invalid'
'Set-Cookie: name=value; Comment="\\012"; expires=123; path=.example.invalid'

Here's the offending line:

https://github.com/python/cpython/blob/b87c1c92fc93c5733cd3d8606ab2301ca6ba208f/Lib/http/cookies.py#L415

Why not quote all attribute values?
History
Date User Action Args
2018-04-20 02:04:19Mark.Williamssetrecipients: + Mark.Williams, zenzen, ajaksu2, alex, zdobersek, berker.peksag
2018-04-20 02:04:19Mark.Williamssetmessageid: <1524189859.86.0.682650639539.issue991266@psf.upfronthosting.co.za>
2018-04-20 02:04:19Mark.Williamslinkissue991266 messages
2018-04-20 02:04:18Mark.Williamscreate