-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to start a process on Windows (#2310)
* Add support to start a process on Windows This is heavily inspired by https://github.com/masthoon/pwintools Allows to use the `process` tube on a Windows host running local processes. I've tried to keep the changes at a minimum. Windows doesn't support non-blocking reads, so I've opted to handle the reading in a separate thread to simulate the non-blocking check. * Fix `misc.which()` on Windows `os.getuid()` is only supported on unix. * Support [read|write]mem, libs and cwd * Update CHANGELOG * Don't cache loaded modules * Wait output on stdout in `process.can_recv_raw` Instead of handling the timeout for reading poorly in `process.recv_raw`, wait for any bytes to be available in `process.can_recv_raw` like on linux. This prevents a 100% spin of one core in `tube.interactive()` since it expects the thread to block for `timeout` seconds while we would return immediately previously. * Remove PythonForWindows dependency This loses the `readmem` and `writemem` feature, but that's not necessary for this basic process startup support. * Fix cyclic imports * Ignore errors in reading thread This could cause a deadlock / fastfail on shutdown when stdout is closed, thus read(1) fails and the exception is tried to be printed to the console while stderr is in the process of getting closed.
- Loading branch information
1 parent
3bb756d
commit c4a3d34
Showing
4 changed files
with
115 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters