Issue 1172011: BaseCookie should call value_decode from getitem (original) (raw)

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.

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.