[New-bugs-announce] [issue24378] dir(dictobject) returns empty list when __getattribute__ is overriden in the class

Alka Yadav report at bugs.python.org
Thu Jun 4 07:06:36 CEST 2015


New submission from Alka Yadav:

When __getattribute__ method is overrriden in a class,then in case of calling 
an attribute not in class object should throw KeyError.

But when calling dir on classs object gives an empty list as dir(dictobject) 
calls dictobject.__getattribute__(dir) and it throws KeyError instead of AttributeError in dir annd it returns NULL upstream

So dir source code need to be fixed to catch KeyError appropriately.

----------
components: Library (Lib)
files: direrror.py
messages: 244798
nosy: alkayadavit07 at gmail.com
priority: normal
severity: normal
status: open
title: dir(dictobject) returns empty list when __getattribute__ is overriden in the class
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file39613/direrror.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24378>
_______________________________________


More information about the New-bugs-announce mailing list