For compatibility with python-3.0, open files in text mode where appropriate.
authorZac Medico <zmedico@gentoo.org>
Thu, 19 Feb 2009 10:24:06 +0000 (10:24 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 19 Feb 2009 10:24:06 +0000 (10:24 -0000)
svn path=/main/trunk/; revision=12642

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

index 29e8657ff3f2e8d6835e48560793b717179b3c1c..46d5f452e43902c170026c6b6cb0087ab9989c43 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 413792606e11070ce6021fe620b5ba440917faee..aab09d86b802dadeb82eef2344611fde24d37032 100644 (file)
@@ -10616,7 +10616,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 9769f3607053aca2c6ca6e609b31c9a26b859404..b025142f91abbb4981ee1b375a2295af83141eca 100644 (file)
@@ -4688,7 +4688,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)