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 peaker
Recipients
Date 2007-06-09.08:04:30
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
_lsprof.c:ptrace_enter_call assumes PyErr_* has no errors.
It assumes this by feeling free to call functions that PyErr_Clear and overwrite PyErr.

This assumption is broken when throwing into a generator. In that case gen_send_ex(.., 1) calls the ptrace_enter_call with an exception already set.

This assumption causes two bugs:
A. The exception thrown into the generator is overwritten and lost. Later it was also cleared.
B. gen_send_ex(..) still returns error-indication, but since the exception was cleared, you get a SystemError (error indication returned but no exception was set).

To fix this, ptrace_enter_call now saves/restores the current PyErr.

The attached patch was applied on the newest trunk svn. I guess it should be applicable without problems on the 2.5 bugfix branch as well.
History
Date User Action Args
2007-08-23 15:58:41adminlinkissue1733973 messages
2007-08-23 15:58:41admincreate