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 vstinner
Recipients ita1024, martin.panter, python-dev, vstinner
Date 2017-01-07.02:42:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwaUMyPb4x6o3RJA6WJLzekLP2Q8_7t0WeoEz11uiAgdSQ@mail.gmail.com>
In-reply-to <1483756215.02.0.7886864591.issue29174@psf.upfronthosting.co.za>
Content
Martin Panter:
> Victor opened Issue 27068 about adding a Popen.detach() method, which such code could use to opt out of the warning.

I opened the issue because you asked me to open it, but I'm not
convinced yet that the design would work. I don't understand yet who
is responsible of the pipes for example, especially pipes opened by
the Popen object itself (ex: stdout=PIPE), not passed to Popen
constructor. It's not as simple as getting a file descriptor as
file.detach() or socket.detach(), a Popen object is made of multiple
resources (pid and pipes at least).

> 2. Revert the warning, and in a future release (e.g. 3.7), add it back along with a way to opt out of the warning.

For this specific issue, the ResourceWarning is correct. I don't
understand the use case of explicitly turning this warning off on this
specific example?

If your output is flooded by ResourceWarning warnings, it's easy to
configure Python to ignore them. Example, simplest option: python3
-Wignore script.py. But you are only going to hide a real issue in
your code. ResourceWarning exists to help you to reduce your resource
consumption.
History
Date User Action Args
2017-01-07 02:42:41vstinnersetrecipients: + vstinner, python-dev, martin.panter, ita1024
2017-01-07 02:42:41vstinnerlinkissue29174 messages
2017-01-07 02:42:41vstinnercreate