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.

Author arigo
Recipients
Date 2006-05-29.16:54:43
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Patch for bug #1275608.

Exceptions occurring when the dict lookup code calls a
user-defined __eq__() are silently eaten.  This has
caused me several hours-long debugging session so far,
so I thought that it was time to fix that.

The proposed patch takes an easy route: it doesn't try
to change PyDict_GetItem(), which still has no way to
report exceptions and just eats them.  Instead, it moves
the exception-eating logic into PyDict_GetItem().  So 
all other ways in which dicts are accessed now correctly
report exceptions.  Most importantly, this includes all
operators and methods accessible from Python code,
including the 'x=d[key]' syntax.

The only incompatibility I could imagine from this would
be from code that relies on the fact that dicts were
previouly tolerant about exceptions: an __eq__ could
fail in any way, and the lookup would consider it as a
"not equal" signal and proceed.  I'd say "fix that". 
However it means that the 2.4 patch attached here should
probably not be applied, sadly.  I'd vote to check in
the 2.5 patch as soon as possible.

Note that these patches sneak in another bugfix patch
too (#1456209) because I couldn't be bothered to
maintain two mutually-conflicting patches.
History
Date User Action Args
2007-08-23 15:52:24adminlinkissue1497053 messages
2007-08-23 15:52:24admincreate