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.

classification
Title: Type returned from .keys() is not checked
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: bhandley, isandler, rhettinger
Priority: normal Keywords:

Created on 2004-08-06 13:56 by bhandley, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21967 - (view) Author: ben handley (bhandley) Date: 2004-08-06 13:56
When passing a mapping object as the locals to eval, it
doesn't check that the return value of .keys() is a
tuple early enough, resulting in a SystemError:

>>> class C:
...     def __getitem__(self, item):
...         raise KeyError, item
...     def keys(self):
...         return 'a'
...
>>> c=C()
>>> print eval('dir()', globals(), c)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 0, in ?
SystemError: Objects/listobject.c:2110: bad argument to
internal function

msg21968 - (view) Author: Ilya Sandler (isandler) Date: 2004-08-06 18:53
Logged In: YES 
user_id=971153

Seems like a duplicate of bug #1004669

I would suggest to either delete or close this bug.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40700
2004-08-06 13:56:52bhandleycreate