Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows tracebacks caused by use of os.setsid & os.killpg #809

Closed
replabrobin opened this issue Jun 29, 2021 · 4 comments · Fixed by #810
Closed

windows tracebacks caused by use of os.setsid & os.killpg #809

replabrobin opened this issue Jun 29, 2021 · 4 comments · Fixed by #810

Comments

@replabrobin
Copy link
Contributor

The watchmedo command attempts to make use of these attributes on windows. The python docs say these are unix only. Whether that includes OSX I cannot say.

@replabrobin
Copy link
Contributor Author

replabrobin commented Jun 29, 2021

I did a few quick hacks in tricks/__init__.py to make this work (at least for python3.9 & windows 10 amd64).

  1. leave off the prexec_fn=os.setsid in the Popen.

  2. turn os.killpg(os.getpgid(self.process.pid), self.stop_signal) into os.kill(self.process_id,self.stop_signal)

that seemed to make things work and a simple watchmedo auto-restart did then work and restart on file events as expected.

@BoboTiG
Copy link
Collaborator

BoboTiG commented Jun 29, 2021

Could you open a PR?

@replabrobin
Copy link
Contributor Author

Done

@BoboTiG BoboTiG linked a pull request Jun 29, 2021 that will close this issue
BoboTiG added a commit that referenced this issue Jun 29, 2021
…ons (#810)

Fixes #809.

Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
@BoboTiG
Copy link
Collaborator

BoboTiG commented Jun 29, 2021

Thanks a lot for the patch 💪

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

Successfully merging a pull request may close this issue.

2 participants