From 46107423f4a039af6528d14cb86123a05a67f85f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 15 Feb 2012 16:33:10 -0800 Subject: Comment about _setup_pipes / PyPy GC interaction. --- pym/_emerge/EbuildFetcher.py | 6 +++++- pym/portage/dbapi/_MergeProcess.py | 6 +++++- 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) -- cgit v1.2.3-1-g7c22