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.
Created on 2014年09月24日 11:22 by chrysn, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test.py | chrysn, 2014年09月24日 11:22 | |||
| test.err | chrysn, 2014年09月24日 11:23 | |||
| destructortest.py | chrysn, 2014年09月24日 11:23 | |||
| Messages (3) | |||
|---|---|---|---|
| msg227440 - (view) | Author: chrysn (chrysn) * | Date: 2014年09月24日 11:22 | |
the attached test.py snipplet, which runs an asyncio main loop to the completion of a coroutine raising SystemExit, runs cleanly when invoked using `python3 test.py`, but shows a logging error from the Task.__del__ method when invoked using `python3 -m test`. the error message (attached as test.err) indicates that the builtins module has already been emptied by the time the Task's destructor is run. i could reproduce the problem with an easier test case without asyncio (destructoretest.py), but then again, there the issue is slightly more obvious (one could argue a "don't do that, then"), and it occurs no matter how the program is run. i'm leaving this initially assigned to asyncio, because (to the best of my knowledge) test.py does not do bad things by itself, and the behavior is inconsistent only there. |
|||
| msg227457 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2014年09月24日 14:47 | |
Running "python test.py" and "python -m test" changes how the code is loaded. With "python test.py", test.py becomes the "__main__" module, whereas "python -m test" uses the "test" module. At Python exit, the __main__ module and other modules are destroyed differently. Anyway, this issue is another example of the issue #22428 and so I close it as duplicate. |
|||
| msg228988 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2014年10月10日 11:36 | |
I created a more specific issue for destructortest.py: issue #22599. It's not directly related to asyncio. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:08 | admin | set | github: 66670 |
| 2014年10月11日 12:38:29 | vstinner | set | status: open -> closed |
| 2014年10月10日 11:36:53 | vstinner | set | messages: + msg228988 |
| 2014年09月24日 14:47:24 | vstinner | set | superseder: asyncio: KeyboardInterrupt inside a coroutine causes AttributeError resolution: duplicate messages: + msg227457 versions: + Python 3.5 |
| 2014年09月24日 11:23:29 | chrysn | set | files: + destructortest.py |
| 2014年09月24日 11:23:08 | chrysn | set | files: + test.err |
| 2014年09月24日 11:22:41 | chrysn | set | files: + test.py |
| 2014年09月24日 11:22:12 | chrysn | create | |