[issue19077] More robust TemporaryDirectory cleanup

Antoine Pitrou report at bugs.python.org
Sun Jan 26 23:53:34 CET 2014


Antoine Pitrou added the comment:

> Here are updated patches for 3.3 and 3.4. Changed tests for 3.4, a patch for 
> 3.3 is changed more. Unfortunately in 3.3 exceptions still can be raised when 
> try to emit a warning during shutdown. Is there any way to determine the 
> shutdown mode?

There's nothing obvious, but a possible hack would be:

_is_shutdown = False

def _on_shutdown():
    global _is_shutdown
    _is_shutdown = True

atexit.register(_on_shutdown)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19077>
_______________________________________


More information about the Python-bugs-list mailing list