Message346343
> 1) disable _cleanup, _active, and remove _internal_poll() for windows
_active only gets appended to in __del__. We can skip the entire body of __del__. Also, calling _cleanup can be skipped in __init__.
_internal_poll is required for poll().
2) ignore EBADF(OSError: [WinError 6] The handle is invalid) in terminate() and probably some other methods
ERROR_INVALID_HANDLE should not be ignored.
terminate() is doing the right thing by not masking ERROR_INVALID_HANDLE. The only concern is the case where our handle has been closed elsewhere (not by subprocess) and the handle value was subsequently reused as a handle for another process to which we have terminate access. This is a bad handle at a logical, application level, but it's valid and accessible for TerminateProcess. It was suggested to initially get the pid and process startup time in order to validate the call, but Alexey Izbyshev is right that it's not worth complicating the code in subprocess to address an uncommon bug in particular application or library code. |
|
Date |
User |
Action |
Args |
2019-06-23 21:24:26 | eryksun | set | recipients:
+ eryksun, gregory.p.smith, paul.moore, tim.golden, zach.ware, steve.dower, efiop |
2019-06-23 21:24:26 | eryksun | set | messageid: <1561325066.55.0.261532226812.issue37380@roundup.psfhosted.org> |
2019-06-23 21:24:26 | eryksun | link | issue37380 messages |
2019-06-23 21:24:26 | eryksun | create | |
|