[issue36067] subprocess terminate() "invalid handle" error when process is gone

Giampaolo Rodola' report at bugs.python.org
Thu Feb 21 10:38:02 EST 2019


New submission from Giampaolo Rodola' <g.rodola at gmail.com>:

Happened in psutil:
https://ci.appveyor.com/project/giampaolo/psutil/builds/22546914/job/rlp112gffyf2o30i

======================================================================
ERROR: psutil.tests.test_process.TestProcess.test_halfway_terminated_process
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\psutil\psutil\tests\test_process.py", line 85, in tearDown
    reap_children()
  File "c:\projects\psutil\psutil\tests\__init__.py", line 493, in reap_children
    subp.terminate()
  File "C:\Python35-x64\lib\subprocess.py", line 1092, in terminate
    _winapi.TerminateProcess(self._handle, 1)
OSError: [WinError 6] The handle is invalid

During the test case, the process was already gone (no PID).

----------
components: Library (Lib)
messages: 336231
nosy: giampaolo.rodola
priority: normal
severity: normal
stage: needs patch
status: open
title: subprocess terminate() "invalid handle" error when process is gone
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36067>
_______________________________________


More information about the Python-bugs-list mailing list