Comment about _setup_pipes / PyPy GC interaction.
authorZac Medico <zmedico@gentoo.org>
Thu, 16 Feb 2012 00:33:10 +0000 (16:33 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 16 Feb 2012 00:33:10 +0000 (16:33 -0800)
pym/_emerge/EbuildFetcher.py
pym/portage/dbapi/_MergeProcess.py

index c0175b3fbaa1a7574558ed3fd5c5e31519c059cc..f6dab5471c9230c7edb03519834502f17617afc8 100644 (file)
@@ -171,7 +171,11 @@ class EbuildFetcher(SpawnProcess):
                        return [pid]
 
                # TODO: Find out why PyPy 1.8 with close_fds=True triggers
-               # "[Errno 9] Bad file descriptor" in subprocesses.
+               # "[Errno 9] Bad file descriptor" in subprocesses. It could
+               # be due to garbage collection of file objects that were not
+               # closed before going out of scope, since PyPy's garbage
+               # collector does not support the refcounting semantics that
+               # CPython does.
                close_fds = platform.python_implementation() != 'PyPy'
                portage.process._setup_pipes(fd_pipes, close_fds=close_fds)
 
index 21d43dd839932e9d01d2a7f5805f9ee4ffbb3af7..9a185b4a69b65930eaf523eb977d054ed4f11a4b 100644 (file)
@@ -157,7 +157,11 @@ class MergeProcess(SpawnProcess):
                os.close(elog_reader_fd)
 
                # TODO: Find out why PyPy 1.8 with close_fds=True triggers
-               # "[Errno 9] Bad file descriptor" in subprocesses.
+               # "[Errno 9] Bad file descriptor" in subprocesses. It could
+               # be due to garbage collection of file objects that were not
+               # closed before going out of scope, since PyPy's garbage
+               # collector does not support the refcounting semantics that
+               # CPython does.
                close_fds = platform.python_implementation() != 'PyPy'
                portage.process._setup_pipes(fd_pipes, close_fds=close_fds)