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 vstinner
Recipients miss-islington, shihai1991, vstinner
Date 2021-01-27.10:28:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611743295.8.0.341352119363.issue42979@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the fix Hai Shi!

> By the way, the import machinery should raise a SystemError if a module exec function raises an exception *and* reports a success: see _Py_CheckFunctionResult().

It's already the case. Example:

>>> import _zoneinfo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: execution of module _zoneinfo raised unreported exception

With this bug:

diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c
index d0c462fb86..fc564b9587 100644
--- a/Modules/_zoneinfo.c
+++ b/Modules/_zoneinfo.c
@@ -2683,6 +2683,7 @@ zoneinfomodule_exec(PyObject *m)
         goto error;
     }
 
+    PyErr_SetString(PyExc_Exception, "BUG");
     return 0;
 
 error:
History
Date User Action Args
2021-01-27 10:28:15vstinnersetrecipients: + vstinner, miss-islington, shihai1991
2021-01-27 10:28:15vstinnersetmessageid: <1611743295.8.0.341352119363.issue42979@roundup.psfhosted.org>
2021-01-27 10:28:15vstinnerlinkissue42979 messages
2021-01-27 10:28:15vstinnercreate