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 Chip Lynch, efiop, emanuel, eryksun, gregory.p.smith, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-09-06.16:48:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567788489.78.0.949880137652.issue37380@roundup.psfhosted.org>
In-reply-to
Content
> When a Popen instance is finalized by the garbage collector, the 
> internal handle is also finalized and closed despite the instance 
> being put on the active list. This results in _cleanup throwing 
> because the handle can no longer be used.

Thanks. I hadn't considered that. It can lead to unusual behavior like this when __del__ keeps an object alive. The object can't assume that referenced objects haven't already been finalized. All of the subsequently required instance methods should take this into account. For example, Popen._internal_poll could set the return code to -1 if self._handle.closed is true. That's at a higher level, and much more reasonable, than trying to handle ERROR_INVALID_HANDLE, which could mask bugs.
History
Date User Action Args
2019-09-06 16:48:09eryksunsetrecipients: + eryksun, gregory.p.smith, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, efiop, emanuel, Chip Lynch
2019-09-06 16:48:09eryksunsetmessageid: <1567788489.78.0.949880137652.issue37380@roundup.psfhosted.org>
2019-09-06 16:48:09eryksunlinkissue37380 messages
2019-09-06 16:48:09eryksuncreate