Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Victor, your patch addresses the symptom of the problem, not the cause.

The cause is that in some cases, the exception context chain is lost. Of
course what could be a minor annoyance becomes dramatic when this
precisely happens in code that makes use of this context.

IMO, PyErr_SetObject should not restore the previous exc_* members; it's
not its job to correct others' mistakes.
I join a patch that only protects it from crashing in this case: it just
saves exc_value in a local variable.

The bug shown by lostcontext2.py is still unresolved, but at least it
won't crash the interpreter.

Added file: http://bugs.python.org/file11207/pyerr_seterror_protect.py

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3611>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to