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.

Title: Interpreter exit blocks waiting for
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: gsakkis, stefosgiwrgos
Priority: normal Keywords:

Created on 2020-11-19 15:02 by gsakkis, last changed 2022-04-11 14:59 by admin.

File name Uploaded Description Edit gsakkis, 2020-11-19 15:02
Messages (1)
msg381433 - (view) Author: George Sakkis (gsakkis) Date: 2020-11-19 15:02 prevents interpreter exit if there is a reference to the generator it returns. In the attached script:

- `python run1` exits as soon as the exception is raised on the main thread. This is the desired behavior in our case.

- `python run2` keeps running until the thread worker processes all queued work items. The only difference from `run1` is that the result of `` is assigned to a variable.

- `python run3` has a `finally` block that shuts down the executor without waiting. Still the worker thread keeps running even after the shutdown.

Initially it seemed like but there is no change in the behavior after commenting out the `atexit.register(_python_exit)` call (for the `run2` case at least).
Date User Action Args
2022-04-11 14:59:38adminsetgithub: 86575
2020-11-19 15:13:12stefosgiwrgossetnosy: + stefosgiwrgos
2020-11-19 15:02:33gsakkiscreate