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 arigo
Recipients arigo
Date 2017-07-19.08:53:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
multiprocessing.queues.SimpleQueue should have a close() method.  This is needed to explicitly release the two file descriptors of the Pipe used internally.  Without it, the file descriptors leak if a reference to the SimpleQueue object happens to stay around for longer than expected (e.g. in a reference cycle, or with PyPy).

I think the following would do:

diff -r 0b72fd1a7641 lib-python/2.7/multiprocessing/
--- a/lib-python/2.7/multiprocessing/  Sun Jul 16 13:41:28 2017 +0200
+++ b/lib-python/2.7/multiprocessing/  Wed Jul 19 10:45:03 2017 +0200
@@ -358,6 +358,11 @@
             self._wlock = Lock()

+    def close(self):
+        # PyPy extension: CPython doesn't have this method!
+        self._reader.close()
+        self._writer.close()
     def empty(self):
         return not self._reader.poll()
Date User Action Args
2017-07-19 08:53:22arigosetrecipients: + arigo
2017-07-19 08:53:22arigosetmessageid: <>
2017-07-19 08:53:22arigolinkissue30966 messages
2017-07-19 08:53:21arigocreate