Antoine Pitrou added the comment:
Well, it's unclear to me why we would want to remove the __main__ module first,
rather than last.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21925
STINNER Victor added the comment:
The problem is tricky.
The modules are deleted in a random order at exit. The problem is that showing
the warning requires to import the linecache module. But during Python
finalization, we may or may not be able to import modules.
Py_Finalize() calls
Roundup Robot added the comment:
New changeset 047da19efdab by Victor Stinner in branch '3.4':
Issue #21925: PyImport_Cleanup(): Remove unused parameter in
http://hg.python.org/cpython/rev/047da19efdab
New changeset b255ecb175c4 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21925:
STINNER Victor added the comment:
I don't know if it's the best trick, but here is a patch to unload the __main__
module first in PyImport_Cleanup().
--
keywords: +patch
Added file: http://bugs.python.org/file35896/unload_main_first.patch
___
Python
New submission from Masami HIRATA:
It seems that ResouceWarning about unclosed file handles with '-W all' option
sometimes doesn't display.
Is this behaviour normal?
$ uname -a
Linux ashrose 3.2.0-65-generic #99-Ubuntu SMP Fri Jul 4 21:03:29 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux
$ python3.4
Ned Deily added the comment:
I believe this is an artifact of hash randomization which affects the order of
how objects are destroyed during shutdown. If you run your test using
different values of the PYTHONHASHSEED environment variable, you'll probably
see predictable results. For