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: BaseCookie should call value_decode from __getitem__
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, orsenthil, r.david.murray, ryan
Priority: normal Keywords: easy

Created on 2005-03-28 18:20 by ryan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg60708 - (view) Author: Ryan Lovett (ryan) Date: 2005-03-28 18:20
Perhaps I'm misunderstanding its functionality, but I
believe BaseCookie should be calling value_decode
during __getitem__. I created a blowfish Cookie class
with value_encode and value_decode methods, but when I
invoke __getitem__, for example mycookie['mykey'], the
cookie only returns encoded values.
msg109888 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-10 16:44
Well should it or shouldn't it?
msg114491 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-21 12:46
No reply to msg109888.
msg114679 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-08-22 15:31
Mark, not many people follow the full bugs list (I'm don't anymore...I just happened to notice this one going by on the IRC channel).   Asking a question without adding appropriate people to nosy is therefore not all that likely to obtain a response, and a lack of response in that situation is not, IMO, sufficient grounds for closing an issue.  If you can't find someone to add to nosy, you could post to python-dev.

From a look at the code it appears to me that this is not valid.  value_decode is called by __ParseString which is called from 'load'.  The cookies are apparently stored in the dict as a Morsel that contains a both a 'real value' and the 'encoded value', and those pairs get created via individual sets (the call to __setitem__), when a load-from-string is done, or by *encoding* the real values when a load-from-dict is done (ie: a mass __setitem__).  

It seems like closing this as invalid is the correct action; however, the OP clearly observed a problem, but we don't have sufficient information to diagnose it.

Ryan, if you are still interested in/seeing this problem, can you supply a test case that demonstrates the issue you observed?  Otherwise we'll close the issue.
msg116164 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-12 10:26
Nor reply to msg114679.
msg117125 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-09-22 03:24
Moreover, BaseCookie should be used only for subclassing. Proper way is to always use SimpleCookie, this was an Invalid bug report.
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41770
2010-09-22 03:24:57orsenthilsetmessages: + msg117125
stage: test needed -> resolved
2010-09-12 10:26:55BreamoreBoysetstatus: pending -> closed

messages: + msg116164
2010-08-22 15:31:12r.david.murraysetstatus: closed -> pending

nosy: + r.david.murray, orsenthil
messages: + msg114679

resolution: not a bug
2010-08-21 12:46:00BreamoreBoysetstatus: open -> closed

messages: + msg114491
2010-07-10 16:44:25BreamoreBoysetnosy: + BreamoreBoy
title: BaseCookie does not call value_decode -> BaseCookie should call value_decode from __getitem__
messages: + msg109888

versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2009-04-22 17:18:11ajaksu2setkeywords: + easy
2009-02-13 21:08:33jjleesetnosy: - jjlee
2009-02-13 01:17:44ajaksu2setnosy: + jjlee
stage: test needed
type: behavior
versions: + Python 2.6, - Python 2.3
2005-03-28 18:20:15ryancreate