Skip to content

[PyInstaller] Workers don't shutdown when started from within a script #625

@hash3liZer

Description

@hash3liZer

When you start & stop proxy.py from command line, it works all fine. However, when using embedded proxy.py in your script, it doesn't totally destroy its workers. The workers are still shown on the Task Manager. I've to manually end the processes.

Consider this example:

import ipaddress
import proxy

if __name__ == "__main__":
    proxy.main(
       hostname = ipaddress.IPv4Address("127.0.0.1"),
       port=8080,
       num_workers=1
    )

Now, compile this script:

$ pyinstaller --onefile script.py

Now, when you run the compiled script:

$ .\agent.exe

And then stop the agent, it would stop the main process which started proxy.py but the proxy.py processes still remains there until forcefully stopped from the task manager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueIssues for new contributors to pick-upTaskTasks & chores related to proxy.pyWindowsIssues found only on Windows OS

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions