[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-23 Thread Ruslan Kuprieiev
New submission from Ruslan Kuprieiev : subprocess keeps the list of active processes in its `_active` list. Whenever you try to Popen a new process, it is immediately (like right in the first line of Popen.__init__ [1]) trying to go clean up the old ones. If one of the processes in that list

[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-23 Thread Ruslan Kuprieiev
Ruslan Kuprieiev added the comment: Hi Eryk! Thanks for a swift reply! So the current plan for fixing it is: 1) disable _cleanup, _active, and remove _internal_poll() for windows 2) ignore EBADF(OSError: [WinError 6] The handle is invalid) in terminate() and probably some other methods

[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-24 Thread Ruslan Kuprieiev
Change by Ruslan Kuprieiev : -- pull_requests: +14176 pull_request: https://github.com/python/cpython/pull/14360 ___ Python tracker <https://bugs.python.org/issue37

[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-24 Thread Ruslan Kuprieiev
Ruslan Kuprieiev added the comment: Thanks for pointing that out! I've submitted a tiny patch to skip ``_collect()`` and ``__del__``. Please find it in the Github PR attached. Looking forward to your feedback! -- ___ Python tracker &

[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-29 Thread Ruslan Kuprieiev
Ruslan Kuprieiev added the comment: The `_active` code is pretty old and has not changed since 2.7, so it makes sense to backport it for now(also, should be very trivial to do that). To me, it doesn't seem dangerous to backport that, but I would love to hear what Eryk and others