Open
Description
- Poetry version: 1.5.1
- Python version: 3.10.7
- OS version and name: Windows 11
- pyproject.toml: Any
- I am on the latest stable Poetry version, installed using a recommended method.
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have consulted the FAQ and blog for any relevant entries or release notes.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option) and have included the output below.
Issue
On non-Windows systems, poetry run
uses os.execvpe
:
poetry/src/poetry/utils/env/generic_env.py
Lines 90 to 91 in 6e94298
Because of how this function replaces the current process, a plugin cannot respond to the TERMINATE
event. atexit
hooks are also not called.
Could subprocess.Popen
simply be used for all systems instead of Windows only?
My use case is that my plugin makes some temporary modifications to set the version number, and it needs to revert them when the command is done. Right now, I just have the plugin ignore poetry run
and poetry shell
since it can't clean up after them.
Activity