Message346635
> 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) |
|
Date |
User |
Action |
Args |
2019-06-26 15:28:33 | eryksun | set | recipients:
+ eryksun, gregory.p.smith, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, efiop |
2019-06-26 15:28:33 | eryksun | set | messageid: <1561562913.63.0.724421724544.issue37380@roundup.psfhosted.org> |
2019-06-26 15:28:33 | eryksun | link | issue37380 messages |
2019-06-26 15:28:33 | eryksun | create | |
|