Issue1497053
Created on 2006年05月29日 16:54 by arigo, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (5) |
|
msg50380 - (view) |
Author: Armin Rigo (arigo) * (Python committer) |
Date: 2006年05月29日 16:54 |
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.
|
|
msg50381 - (view) |
Author: Armin Rigo (arigo) * (Python committer) |
Date: 2006年05月29日 17:47 |
Logged In: YES
user_id=4771
Updated the patches; added more tests for 2.5.
|
|
msg50382 - (view) |
Author: Armin Rigo (arigo) * (Python committer) |
Date: 2006年06月01日 13:19 |
Logged In: YES
user_id=4771
Checked in as r46589.
|
|
msg50383 - (view) |
Author: Tim Peters (tim.peters) * (Python committer) |
Date: 2006年06月01日 15:53 |
Logged In: YES
user_id=31435
Thank you! Marking as Closed. I made a few minor changes
(you checked it in while I was reviewing the patch), but you
won't object to them ;-)
|
|
msg50384 - (view) |
Author: Armin Rigo (arigo) * (Python committer) |
Date: 2006年06月01日 19:14 |
Logged In: YES
user_id=4771
Oups, I left an 'unsigned int' by mistake. Thanks.
(Sidenotedly, you and me closed all three related SF trackers
at about the same time, so I guess it's why each of us
thinks he's the one that closed them :-)
|
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2022年04月11日 14:56:17 | admin | set | github: 43432 |
| 2006年05月29日 16:54:43 | arigo | create |