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 berker.peksag
Recipients Mark.Williams, ajaksu2, alex, berker.peksag, zdobersek, zenzen
Date 2018-04-20.03:04:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
>>> from http.cookies import SimpleCookie
>>> c = SimpleCookie()
>>> c['name'] = 'value'
>>> c['name']['comment'] = '\n'
>>> c['name']['expires'] = '123; path=.example.invalid'
'Set-Cookie: name=value; Comment="\\012"; expires=123; path=.example.invalid'

What do you think that the snippet above should return?

    'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT; path=.example.invalid'


    'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT; path=".example.invalid"'


    'Set-Cookie: name=value; Comment="\\012"; expires=123; path=".example.invalid"'


I don't think the path attribute (or all of them) needs to be quoted unconditionally. Looking at, it looks like quoting for cookie-value is optional.

Is there a use case or examples from other programming languages you can share with us?
Date User Action Args
2018-04-20 03:04:19berker.peksagsetrecipients: + berker.peksag, zenzen, ajaksu2, alex, zdobersek, Mark.Williams
2018-04-20 03:04:19berker.peksagsetmessageid: <>
2018-04-20 03:04:19berker.peksaglinkissue991266 messages
2018-04-20 03:04:18berker.peksagcreate