You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2014-10-11.12:38:29.571>created_at=<Date2014-09-24.11:22:12.229>labels= ['expert-asyncio']
title='SystemExit out of run_until_complete causes AttributeError when using python3 -m'updated_at=<Date2014-10-11.12:38:29.570>user='https://github.com/chrysn'
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.
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 bpo-22428 and so I close it as duplicate.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: