[New-bugs-announce] [issue1615] descriptor protocol bug
report at bugs.python.org
Thu Dec 13 21:13:37 CET 2007
New submission from ganges master:
it seems the code of PyObject_GenericGetAttr, which invokes the
descriptor protocol, silences any AttributeErrors raised by the
descriptor, for classes that also define __getattr__. it should
propagate up rather than being silently ignored.
the attached example is quite artificial, but it's a simplification of
real world code i had hard time debugging. turned out i misspelled an
attribute name inside the property getter function, which raised an
AttributeError as expected -- but the exception i got was quite
misleading, saying the instance has no attribute named so.
this bug only happens when the class defines a custom __getattr__. see
attached demo file for details.
components: Interpreter Core
title: descriptor protocol bug
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file8943/demo.txt
Tracker <report at bugs.python.org>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the New-bugs-announce