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.

Title: Cookie.BaseCookie has ambiguous unicode handling
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: unicode support in Cookie module
View: 11315
Assigned To: Nosy List: AstraLuma,, jafo, martin.panter, michael.foord, terry.reedy
Priority: normal Keywords: patch

Created on 2008-02-29 20:07 by AstraLuma, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg63145 - (view) Author: Jamie Bliss (AstraLuma) Date: 2008-02-29 20:07
The primary offender is in BaseCookie.load(), which uses the test:
    type(rawdata) == type("")
which should be:
    isinstance(rawdata, basestring)
msg64149 - (view) Author: Sean Reifschneider (jafo) * (Python committer) Date: 2008-03-20 04:43
Fix is inline.
msg107426 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-06-09 22:08
Sean, I don't understand 'inline' in this context.
msg124001 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-12-15 01:55
Presumably not an issue for 3.1/3.2.

(Terry - I assume Sean means the fix is in the bug report comment when he says 'inline'.) A patch and a test would still be nice.
msg124003 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-12-15 02:34
This is not a security issue, so removal of 2.6 was right the first time.
Changing the one line would be easy, but I know nothing about what is correct or if there is even a standard for cookies.
msg124020 - (view) Author: Charles Duffy ( Date: 2010-12-15 15:02
Only the Comment field of a cookie is required by RFC2965 to support Unicode -- and several major browsers either mangle or discard cookies containing even high-ASCII values.

Consequently, while some kind of unicode support is appropriate to implement, any program depending on end-to-end support for unicode-encoded cookies is in practice behaving perilously.
msg334411 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2019-01-27 02:03
Same as Issue 11315, where Éric suggested documenting the behaviour.
Date User Action Args
2022-04-11 14:56:31adminsetgithub: 46465
2019-01-27 02:04:48martin.pantersetstatus: open -> closed
stage: test needed -> resolved
2019-01-27 02:03:56martin.pantersetnosy: + martin.panter
messages: + msg334411
resolution: duplicate

superseder: unicode support in Cookie module
2014-12-31 16:19:50akuchlingsetnosy: - akuchling
2010-12-15 15:02:48charles@dyfis.netsetnosy: +
messages: + msg124020
2010-12-15 02:34:51terry.reedysetnosy: akuchling, terry.reedy, jafo, AstraLuma, michael.foord
versions: - Python 2.6
messages: + msg124003
stage: test needed
2010-12-15 01:56:52michael.foordsetnosy: akuchling, terry.reedy, jafo, AstraLuma, michael.foord
versions: + Python 2.6
2010-12-15 01:55:45michael.foordsetnosy: akuchling, terry.reedy, jafo, AstraLuma, michael.foord
messages: + msg124001
versions: + Python 2.7, - Python 2.6
2010-12-15 01:53:42michael.foordsetnosy: + michael.foord
2010-11-12 20:55:46akuchlingsetassignee: akuchling ->
2010-06-09 22:08:02terry.reedysetnosy: + terry.reedy

messages: + msg107426
versions: - Python 2.5
2008-03-20 04:43:57jafosetpriority: normal
assignee: akuchling
messages: + msg64149
keywords: + patch
nosy: + akuchling, jafo
2008-02-29 20:07:48AstraLumacreate