From: Zac Medico Date: Fri, 16 Dec 2011 19:18:20 +0000 (-0800) Subject: SpawnProcess: remove obsolete fdopen X-Git-Tag: v2.2.0_alpha82~58 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f75fc7375ea902da2e96825ca27c8b7f5031a491;p=portage.git 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. --- 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