From: Zac Medico Date: Wed, 11 Mar 2009 05:52:24 +0000 (-0000) Subject: For compatibility with python-3.0, open files in text mode where appropriate. X-Git-Tag: v2.1.6.8~163 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=541f525a71fb9bbe97e1200dd03ac7eb9c8d7f2c;p=portage.git For compatibility with python-3.0, open files in text mode where appropriate. (trunk r12642) svn path=/main/branches/2.1.6/; revision=12914 --- diff --git a/bin/repoman b/bin/repoman index 70a0587a6..7b5daf353 100755 --- a/bin/repoman +++ b/bin/repoman @@ -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 diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index df6b3c80f..69f29ae7b 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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 diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 5326a0acd..88db818e9 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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 diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py index ad95c975d..a09b73229 100644 --- a/pym/portage/elog/messages.py +++ b/pym/portage/elog/messages.py @@ -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: diff --git a/pym/portage/env/loaders.py b/pym/portage/env/loaders.py index 61bb69126..b23c7f393 100644 --- a/pym/portage/env/loaders.py +++ b/pym/portage/env/loaders.py @@ -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)