Skip to content

Plugins cannot respond to TERMINATE event on non-Windows systems after poetry run #8092

Open
@mtkennerly

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:

if not self._is_windows:
return os.execvpe(command[0], command, env=env)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/plugin-apiRelated to plugins/plugin APIarea/windowsFor Windows-specific issueskind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions