classification
Title: assert that functions clearing the current exception are not called with an exception set
Type: Stage:
Components: Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2014-06-24 09:49 by vstinner, last changed 2014-07-01 15:17 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
assert_exc.patch vstinner, 2014-06-24 09:49 review
Messages (3)
msg221444 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-06-24 09:49
Attached patch detects (when Python is compiled in debug mode) if functions that may clear the current exception are called with an exception set.

The check avoids loosing an exception.

The problem is that the test_sqlite fails with the patch applied. I will open a new patch for that.

I already added similar checks in functions of Python/ceval.c.
msg221446 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-06-24 09:51
> The problem is that the test_sqlite fails with the patch applied. I will open a new patch for that.

I opened the issue #21858 for that.
msg222046 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-01 15:17
I don't think anymore that it's a good idea. Almost all C functions can replace the current Python exception. There is no reason to add assertions only in a few functions.
History
Date User Action Args
2014-07-01 15:17:36vstinnersetstatus: open -> closed
resolution: not a bug
messages: + msg222046
2014-06-24 09:51:24vstinnersetmessages: + msg221446
2014-06-24 09:49:31vstinnercreate