classification
Title: Cookie.BaseCookie has ambiguous unicode handling
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, astronouth7303, charles@dyfis.net, jafo, michael.foord, terry.reedy
Priority: normal Keywords: patch

Created on 2008-02-29 20:07 by astronouth7303, last changed 2010-12-15 15:02 by charles@dyfis.net.

Messages (6)
msg63145 - (view) Author: Jamie Bliss (astronouth7303) 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 (charles@dyfis.net) 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.
History
Date User Action Args
2010-12-15 15:02:48charles@dyfis.netsetnosy: + charles@dyfis.net
messages: + msg124020
2010-12-15 02:34:51terry.reedysetnosy: akuchling, terry.reedy, jafo, astronouth7303, michael.foord
versions: - Python 2.6
messages: + msg124003
stage: test needed
2010-12-15 01:56:52michael.foordsetnosy: akuchling, terry.reedy, jafo, astronouth7303, michael.foord
versions: + Python 2.6
2010-12-15 01:55:45michael.foordsetnosy: akuchling, terry.reedy, jafo, astronouth7303, 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:48astronouth7303create