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, vstinner, zach.ware
Date 2019-06-26.15:28:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561562913.63.0.724421724544.issue37380@roundup.psfhosted.org>
In-reply-to
Content
> The process is not polled to be able to emit the warning in more 
> cases, again, to ease debug.

It emits an incorrect warning if the process has already exited: "subprocess %s is still running". This can be rectified. Here's my current understanding:

    def __del__(self, _maxsize=sys.maxsize, _warn=warnings.warn):
        if not self._child_created or self.returncode is not None:
            return
        # In Unix, not reading the subprocess exit status creates a zombie
        # process, which is only destroyed at the parent Python process exit.
        # In Windows, no one else should have a reference to our _handle, so
        # it should get finalized and thus closed, but we use the same warning
        # in order to consistently educate developers.
        if self._internal_poll(_deadstate=_maxsize) is not None:
            _warn("subprocess %s was implicitly finalized" % self.pid,
                  ResourceWarning, source=self)
        else:
            _warn("subprocess %s is still running" % self.pid,
                  ResourceWarning, source=self)
            # Keep this instance alive until we can wait on it, if needed.
            if _active is not None:
                _active.append(self)
History
Date User Action Args
2019-06-26 15:28:33eryksunsetrecipients: + eryksun, gregory.p.smith, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, efiop
2019-06-26 15:28:33eryksunsetmessageid: <1561562913.63.0.724421724544.issue37380@roundup.psfhosted.org>
2019-06-26 15:28:33eryksunlinkissue37380 messages
2019-06-26 15:28:33eryksuncreate