Inside portage.spawn(), open files for logfile handling in binary mode, for
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Feb 2009 02:44:24 +0000 (02:44 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Feb 2009 02:44:24 +0000 (02:44 -0000)
compatibility with python-3.0.

svn path=/main/trunk/; revision=12668

pym/portage/__init__.py

index 3be6e651f3c7ecc04f7dac9b1f52b4aeff962f5b..c18d430137f9924dff2968ef412654d6eff255bb 100644 (file)
@@ -3198,9 +3198,9 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
                return mypids
 
        if logfile:
-               log_file = open(logfile, 'a')
-               stdout_file = os.fdopen(os.dup(fd_pipes_orig[1]), 'w')
-               master_file = os.fdopen(master_fd, 'r')
+               log_file = open(logfile, mode='ab')
+               stdout_file = os.fdopen(os.dup(fd_pipes_orig[1]), 'wb')
+               master_file = os.fdopen(master_fd, 'rb')
                iwtd = [master_file]
                owtd = []
                ewtd = []