[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Thanks Serhiy and Naoki. I really wanted more eyes on this weird issue :-) It's also a reminder that we should be careful when converting keyword arguments, especially when duplicates are not allowed. -- ___ Python

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2d2210b36b25 by Victor Stinner in branch 'default': Issue #29360: _PyStack_AsDict() doesn't check kwnames https://hg.python.org/cpython/rev/2d2210b36b25 -- nosy: +python-dev ___ Python tracker

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: pystack_asdict-2.patch LGTM. -- assignee: -> haypo stage: -> commit review ___ Python tracker ___

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: > I don't know. To that that is crashed when pass non-string keys. Oh ok. I found a way to create a dictionary with equal keys and pass it to dict(**kw) in my fast_init branch (I already removed the PyUnicode_Check() asssertion in this branch): haypo@selma$

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't know. To that that is crashed when pass non-string keys. -- ___ Python tracker ___

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "Try following keys: (...)" To which function am I supposed to pass such keys? I was unable to find a simple way how to pass arbitrary keys to _PyStack_AsDict(). -- ___ Python tracker

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Try following keys: class Key: def __eq__(self, other): return self is other or random.getrandbits(1) def __hash__(self): return random.getrandbits(1) -- ___ Python tracker

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: Don't check if all keys are strings in _PyStack_AsDict() -> _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique ___ Python tracker