For compatibility with python-3.0, open files in text mode where appropriate.
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:52:24 +0000 (05:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:52:24 +0000 (05:52 -0000)
(trunk r12642)

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

bin/repoman
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/elog/messages.py
pym/portage/env/loaders.py

index 70a0587a6caf9da6864d948f37f3b2f4aaaeeb43..7b5daf353cb263e86763ee2cdfd73b179f982af8 100755 (executable)
@@ -600,7 +600,7 @@ profiles={}
 valid_profile_types = frozenset(["dev", "exp", "stable"])
 descfile=portdir+"/profiles/profiles.desc"
 if os.path.exists(descfile):
-       for i, x in enumerate(open(descfile, 'rb')):
+       for i, x in enumerate(open(descfile)):
                if x[0]=="#":
                        continue
                arch=x.split()
@@ -1444,7 +1444,7 @@ for x in scanlist:
                # Syntax Checks
                relative_path = os.path.join(x, y + ".ebuild")
                full_path = os.path.join(repodir, relative_path)
-               f = open(full_path, 'rb')
+               f = open(full_path)
                try:
                        for check_name, e in run_checks(f, pkg):
                                stats[check_name] += 1
index df6b3c80ff1f8cc5af3f9afd974e30b113201217..69f29ae7ba89c8bd96ab3d7ef8aa319a4e663c9c 100644 (file)
@@ -10600,7 +10600,7 @@ class Scheduler(PollScheduler):
                        log_path = self._locate_failure_log(failed_pkg)
                        if log_path is not None:
                                try:
-                                       log_file = open(log_path, 'rb')
+                                       log_file = open(log_path)
                                except IOError:
                                        pass
 
index 5326a0acd4d0b3faa64be3f1d1ed9ce52d252cb0..88db818e93156094af3e3d3a46b596bd5c75ef8b 100644 (file)
@@ -4678,7 +4678,7 @@ def _check_build_log(mysettings, out=None):
        if logfile is None:
                return
        try:
-               f = open(logfile, 'rb')
+               f = open(logfile)
        except EnvironmentError:
                return
 
index ad95c975dafe83a12c2303d4a10e0b23160e7b47..a09b73229d05419fd58a5e199a2f59860201866b 100644 (file)
@@ -35,7 +35,7 @@ def collect_ebuild_messages(path):
                        logentries[msgfunction] = []
                lastmsgtype = None
                msgcontent = []
-               for l in open(filename, "rb"):
+               for l in open(filename):
                        if not l:
                                continue
                        try:
index 61bb6912661cfca1e297efe3257bfd9b99a17b4f..b23c7f39350df22da8ea24512861005b2159b34a 100644 (file)
@@ -132,7 +132,7 @@ class FileLoader(DataLoader):
                # once, which may be expensive due to digging in child classes.
                func = self.lineParser
                for fn in RecursiveFileLoader(self.fname):
-                       f = open(fn, 'rb')
+                       f = open(fn)
                        for line_num, line in enumerate(f):
                                func(line, line_num, data, errors)
                return (data, errors)