[issue16718] Mysterious atexit fail

2021-04-16 Thread Irit Katriel
Change by Irit Katriel : -- stage: -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue16718] Mysterious atexit fail

2021-02-15 Thread Irit Katriel
Irit Katriel added the comment: Since this was fixed since 3.3, is there a reason why this issue is still open? I don't get the error anymore: C:\Users\User\src\cpython-dev>python.bat wow.py Running Release|x64 interpreter... Traceback (most recent call last): File "C:\Users\User\src\cpyth

[issue16718] Mysterious atexit fail

2012-12-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: Perhaps the simplest thing would be to stop doing anything special when a module is garbage collected: the garbage collector can take care of any orphaned ref-cycles involving the module dict. Then at shutdown the remaining modules in sys.modules could have

[issue16718] Mysterious atexit fail

2012-12-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I don't know, you should probably ask there. One blocker is to make builtin and extension modules participate in GC, search "pep3121" to see the many intermediate issues. -- ___ Python tracker

[issue16718] Mysterious atexit fail

2012-12-19 Thread Richard Oudkerk
Richard Oudkerk added the comment: > See issue812369 for the shutdown procedure and modules cleanup. I am aware of that issue, but the original patch is 9 years old. Which is why I ask if/when it will actually happen. -- ___ Python tracker

[issue16718] Mysterious atexit fail

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: See issue812369 for the shutdown procedure and modules cleanup. -- ___ Python tracker ___ ___

[issue16718] Mysterious atexit fail

2012-12-19 Thread Richard Oudkerk
Richard Oudkerk added the comment: > Things should be better in the future, when modules are cleared with true > garbage collection. When is this future of which you speak? I am not sure whether it would affect performance, but a weakrefable subclass of dict could be used for module dicts. T

[issue16718] Mysterious atexit fail

2012-12-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: -serhiy.storchaka versions: -Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue16718] Mysterious atexit fail

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: OK, found the difference between 3.2 and 3.3: The ImportError exception is still alive when atexit handlers are called, with its __traceback__, and all local variables in Python frames. And since 3.3 the import system is built with Python functions... Mor

[issue16718] Mysterious atexit fail

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Infortunately, the behaviour is the same in 2.7 and 3.2, and only changes with 3.3, which means that this is probably related to the new implementation of the import system. This won't be backported. [It would be interesting to understand why there is a

[issue16718] Mysterious atexit fail

2012-12-19 Thread anatoly techtonik
anatoly techtonik added the comment: This is not repeatable in Python 3. Is it possible to fix it for Python 2 as well? Is it possible to postpone registration until the import is finished successfully? Or at least give atexit handler a chance to run before global variable stack is purged? Or

[issue16718] Mysterious atexit fail

2012-12-18 Thread Richard Oudkerk
Richard Oudkerk added the comment: When you run wy.py the wow module gets partially imported, and then garbage collected because it fails to import successfully. The destructor for the module replaces values in the module's __dict__ with None. So when the cleanup function runs you get the un

[issue16718] Mysterious atexit fail

2012-12-18 Thread anatoly techtonik
anatoly techtonik added the comment: But why _Cleanup is not None when wow.py is executed standalone? -- ___ Python tracker ___ ___ Py

[issue16718] Mysterious atexit fail

2012-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It's because _Cleanup is None (as all global variables) when atexit registered functions executed. Don't use globals in such code. -- nosy: +serhiy.storchaka ___ Python tracker

[issue16718] Mysterious atexit fail

2012-12-18 Thread anatoly techtonik
anatoly techtonik added the comment: >py wy.py Traceback (most recent call last): File "wy.py", line 1, in import wow File "E:\scons\wow.py", line 12, in import fail ImportError: No module named fail Error in atexit._run_exitfuncs: Traceback (most recent call last): File "C:\Pytho

[issue16718] Mysterious atexit fail

2012-12-18 Thread anatoly techtonik
anatoly techtonik added the comment: ...one ImportError and *two* TypeError exceptions. -- ___ Python tracker ___ ___ Python-bugs-list

[issue16718] Mysterious atexit fail

2012-12-18 Thread anatoly techtonik
Changes by anatoly techtonik : Added file: http://bugs.python.org/file28354/wy.py ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue16718] Mysterious atexit fail

2012-12-18 Thread anatoly techtonik
Changes by anatoly techtonik : Added file: http://bugs.python.org/file28353/wow.py ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue16718] Mysterious atexit fail

2012-12-18 Thread anatoly techtonik
New submission from anatoly techtonik: Weird bug. Attached are two files: wow.py and wy.py When wow.py is executed - it fails with single ImportError. But when wy.py is executed (which is a simple "import wow" statement) it fails with one ImportError and TypeError exceptions. -- compone