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 ita1024
Recipients ita1024
Date 2017-01-06.07:48:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483688938.47.0.507597836624.issue29174@psf.upfronthosting.co.za>
In-reply-to
Content
Please try the attached testcase with `python3.6 test.py`; Python 3.6 displays unnecessary warnings of the following form:

$ ../test.py
Exception ignored in: <bound method Popen.__del__ of <subprocess.Popen object at 0x7fe6744fc5c0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/subprocess.py", line 761, in __del__
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method Popen.__del__ of <subprocess.Popen object at 0x7fe6744fc550>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/subprocess.py", line 761, in __del__

These warnings appear because of the line "warnings.warn" recently added in subprocess.Popen.__del__:
1. The call to warnings.warn is not usable during interpreter shutdown (and running `python -W ignore test.py` has no effect)
2. Calling "process.terminate()" or "process.kill()" at in the testcase or in an atexit handler would not get rid of the warning, one must set the return code on the Popen object
3. The warning can show up in existing code that has absolutely no zombie problems.

I suggest to revert the recently added warning from subprocess.py:

"""
@@ -754,11 +995,6 @@
         if not self._child_created:
             # We didn't get to successfully create a child process.
             return
-        if self.returncode is None:
-            # Not reading subprocess exit status creates a zombi process which
-            # is only destroyed at the parent python process exit
-            warnings.warn("subprocess %s is still running" % self.pid,
-                          ResourceWarning, source=self)
         # In case the child hasn't been waited on, check if it's done.
         self._internal_poll(_deadstate=_maxsize)
         if self.returncode is None and _active is not None:
"""
History
Date User Action Args
2017-01-06 07:48:58ita1024setrecipients: + ita1024
2017-01-06 07:48:58ita1024setmessageid: <1483688938.47.0.507597836624.issue29174@psf.upfronthosting.co.za>
2017-01-06 07:48:58ita1024linkissue29174 messages
2017-01-06 07:48:56ita1024create