[Zope-Coders] new getattr behaviour in Python 2.2b1 breaks traversal code
Barry A. Warsaw
barry@zope.com
Mon, 12 Nov 2001 00:47:22 -0500
>>>>> "SA" == Steve Alexander <steve@cat-box.net> writes:
SA> Is the current Python 2.2 behaviour going to stay around for
SA> 2.2 final?
Apparently so. Here's an excerpt from bltinmodule.c's CVS log:
----------------------------
revision 2.241
date: 2001/10/16 21:31:32; author: gvanrossum; state: Exp; lines: +3 -1
SF patch #471852 (anonymous) notes that getattr(obj, name, default)
masks any exception, not just AttributeError. Fix this.
----------------------------
and the Misc/NEWS file:
- getattr(obj, name, default) now only catches AttributeError, as
documented, rather than returning the default value for all
exceptions (which could mask bugs in a __getattr__ hook, for
example).
So clearly, Guido intended to make this change.
-Barry