This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients efiop, eryksun, gregory.p.smith, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-06-23.21:24:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561325066.55.0.261532226812.issue37380@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2019-06-23 21:24:26eryksunsetrecipients: + eryksun, gregory.p.smith, paul.moore, tim.golden, zach.ware, steve.dower, efiop
2019-06-23 21:24:26eryksunsetmessageid: <1561325066.55.0.261532226812.issue37380@roundup.psfhosted.org>
2019-06-23 21:24:26eryksunlinkissue37380 messages
2019-06-23 21:24:26eryksuncreate