Patches item #1497053, was opened at 2006-05-29 16:54 Message generated for change (Settings changed) made by arigo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1497053&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core (C code) Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Armin Rigo (arigo) Assigned to: Nobody/Anonymous (nobody) Summary: Let dicts propagate the exceptions in user __eq__ Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Armin Rigo (arigo) Date: 2006-06-01 13:19 Message: Logged In: YES user_id=4771 Checked in as r46589. ---------------------------------------------------------------------- Comment By: Armin Rigo (arigo) Date: 2006-05-29 17:47 Message: Logged In: YES user_id=4771 Updated the patches; added more tests for 2.5. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1497053&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches