New submission from STINNER Victor:

Because of a bug, warnings were not emitted during Python shutdown. I fixed the 
bug in issue #19424, and now Python crashs when a warning is emitted during 
shutdown.

See also issue #19421: "FileIO destructor imports indirectly the io module at 
exit".

The warnings module uses globals()['__name__'] to get the name of the current 
module. The bug was the during Python shutdown, the module is None and 
_PyUnicode_AsString(None) was raising an exception (in setup_context() of 
_warnings.c) and so the warning was not emitted. For example, FileIO destructor 
emits a warning when a unclosed file is destroyed. The destructor removes the 
exception raised the warning module.

----------
messages: 201695
nosy: haypo
priority: normal
severity: normal
status: open
title: Python crashs when a warning is emitted during shutdown
type: crash
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19442>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to