From f75fc7375ea902da2e96825ca27c8b7f5031a491 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 16 Dec 2011 11:18:20 -0800 Subject: [PATCH] SpawnProcess: remove obsolete fdopen Since commit 30d2d0a9db486c5a70848ad5d27b37a3ec48f271, we use os.read() due to bugs in array.fromfile(), so there's no need to use fdopen. --- pym/_emerge/SpawnProcess.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py index c2f492873..9f83ef0de 100644 --- a/pym/_emerge/SpawnProcess.py +++ b/pym/_emerge/SpawnProcess.py @@ -46,6 +46,7 @@ class SpawnProcess(SubProcess): master_fd, slave_fd = self._pipe(fd_pipes) fcntl.fcntl(master_fd, fcntl.F_SETFL, fcntl.fcntl(master_fd, fcntl.F_GETFL) | os.O_NONBLOCK) + files.process = master_fd logfile = None if self._can_log(slave_fd): @@ -75,9 +76,6 @@ class SpawnProcess(SubProcess): if fd == sys.stderr.fileno(): sys.stderr.flush() - # WARNING: It is very important to use unbuffered mode here, - # in order to avoid issue 5380 with python3. - files.process = os.fdopen(master_fd, 'rb', 0) if logfile is not None: fd_pipes_orig = fd_pipes.copy() @@ -120,7 +118,7 @@ class SpawnProcess(SubProcess): kwargs["returnpid"] = True kwargs.pop("logfile", None) - self._reg_id = self.scheduler.register(files.process.fileno(), + self._reg_id = self.scheduler.register(files.process, self._registered_events, output_handler) self._registered = True -- 2.26.2