Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseCookie should call value_decode from __getitem__ #41770

Closed
ryan mannequin opened this issue Mar 28, 2005 · 6 comments
Closed

BaseCookie should call value_decode from __getitem__ #41770

ryan mannequin opened this issue Mar 28, 2005 · 6 comments
Labels
easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ryan
Copy link
Mannequin

ryan mannequin commented Mar 28, 2005

BPO 1172011
Nosy @orsenthil, @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-09-12.10:26:55.594>
created_at = <Date 2005-03-28.18:20:15.000>
labels = ['easy', 'invalid', 'type-bug', 'library']
title = 'BaseCookie should call value_decode from __getitem__'
updated_at = <Date 2010-09-22.03:24:57.568>
user = 'https://bugs.python.org/ryan'

bugs.python.org fields:

activity = <Date 2010-09-22.03:24:57.568>
actor = 'orsenthil'
assignee = 'none'
closed = True
closed_date = <Date 2010-09-12.10:26:55.594>
closer = 'BreamoreBoy'
components = ['Library (Lib)']
creation = <Date 2005-03-28.18:20:15.000>
creator = 'ryan'
dependencies = []
files = []
hgrepos = []
issue_num = 1172011
keywords = ['easy']
message_count = 6.0
messages = ['60708', '109888', '114491', '114679', '116164', '117125']
nosy_count = 4.0
nosy_names = ['orsenthil', 'ryan', 'r.david.murray', 'BreamoreBoy']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1172011'
versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

@ryan
Copy link
Mannequin Author

ryan mannequin commented Mar 28, 2005

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.

@ryan ryan mannequin added the stdlib Python modules in the Lib dir label Mar 28, 2005
@devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label Feb 13, 2009
@devdanzin devdanzin mannequin added the easy label Apr 22, 2009
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Jul 10, 2010

Well should it or shouldn't it?

@BreamoreBoy BreamoreBoy mannequin changed the title BaseCookie does not call value_decode BaseCookie should call value_decode from __getitem__ Jul 10, 2010
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Aug 21, 2010

No reply to msg109888.

@BreamoreBoy BreamoreBoy mannequin closed this as completed Aug 21, 2010
@bitdancer
Copy link
Member

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.

@bitdancer bitdancer reopened this Aug 22, 2010
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Sep 12, 2010

Nor reply to msg114679.

@BreamoreBoy BreamoreBoy mannequin closed this as completed Sep 12, 2010
@orsenthil
Copy link
Member

Moreover, BaseCookie should be used only for subclassing. Proper way is to always use SimpleCookie, this was an Invalid bug report.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants