aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-02-15 16:33:10 -0800
committerZac Medico <zmedico@gentoo.org>2012-02-15 16:33:10 -0800
commit46107423f4a039af6528d14cb86123a05a67f85f (patch)
tree38396f84b7ee738da816a484474c4aeadad85c82 /pym
parentSpawnProcess: use os.open for /dev/null input (diff)
downloadportage-46107423f4a039af6528d14cb86123a05a67f85f.tar.gz
portage-46107423f4a039af6528d14cb86123a05a67f85f.tar.bz2
portage-46107423f4a039af6528d14cb86123a05a67f85f.zip
Comment about _setup_pipes / PyPy GC interaction.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/EbuildFetcher.py6
-rw-r--r--pym/portage/dbapi/_MergeProcess.py6
2 files changed, 10 insertions, 2 deletions
diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index c0175b3fb..f6dab5471 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -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)
diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py
index 21d43dd83..9a185b4a6 100644
--- a/pym/portage/dbapi/_MergeProcess.py
+++ b/pym/portage/dbapi/_MergeProcess.py
@@ -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)