For python-3.0 compatibility, open files in binary mode inside
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:02:25 +0000 (06:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:02:25 +0000 (06:02 -0000)
SpawnProcess._start(). (trunk r12666)

svn path=/main/branches/2.1.6/; revision=12929

pym/_emerge/__init__.py

index 9737952b35c65d425531e2bcae6f90b79b23e1d9..aeb4f0b5ef04f7ab41e0494bcdb40d57203d0811 100644 (file)
@@ -2255,19 +2255,19 @@ class SpawnProcess(SubProcess):
                else:
                        fd_pipes[0] = fd_pipes_orig[0]
 
-               files.process = os.fdopen(master_fd, 'r')
+               files.process = os.fdopen(master_fd, 'rb')
                if logfile is not None:
 
                        fd_pipes[1] = slave_fd
                        fd_pipes[2] = slave_fd
 
-                       files.log = open(logfile, "a")
+                       files.log = open(logfile, mode='ab')
                        portage.util.apply_secpass_permissions(logfile,
                                uid=portage.portage_uid, gid=portage.portage_gid,
                                mode=0660)
 
                        if not self.background:
-                               files.stdout = os.fdopen(os.dup(fd_pipes_orig[1]), 'w')
+                               files.stdout = os.fdopen(os.dup(fd_pipes_orig[1]), 'wb')
 
                        output_handler = self._output_handler