Use explicit 'mode' keyword arg with io.open().
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Jul 2011 20:04:15 +0000 (13:04 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 12 Jul 2011 20:04:15 +0000 (13:04 -0700)
pym/portage/package/ebuild/doebuild.py

index 53a3f9acf21a05bf599a12355de978cf9c11ab29..af67e4e210d84d0429e174f1bc91fc7c6c1ff44c 100644 (file)
@@ -1587,12 +1587,12 @@ def _post_src_install_uid_fix(mysettings, out):
 
        io.open(_unicode_encode(os.path.join(build_info_dir,
                'SIZE'), encoding=_encodings['fs'], errors='strict'),
-               'w', encoding=_encodings['repo.content'],
+               mode='w', encoding=_encodings['repo.content'],
                errors='strict').write(_unicode_decode(str(size) + '\n'))
 
        io.open(_unicode_encode(os.path.join(build_info_dir,
                'BUILD_TIME'), encoding=_encodings['fs'], errors='strict'),
-               'w', encoding=_encodings['repo.content'],
+               mode='w', encoding=_encodings['repo.content'],
                errors='strict').write(_unicode_decode(str(int(time.time())) + '\n'))
 
        use = frozenset(mysettings['PORTAGE_USE'].split())
@@ -1650,7 +1650,7 @@ def _post_src_install_soname_symlinks(mysettings, out):
        try:
                lines = io.open(_unicode_encode(needed_filename,
                        encoding=_encodings['fs'], errors='strict'),
-                       'r', encoding=_encodings['repo.content'],
+                       mode='r', encoding=_encodings['repo.content'],
                        errors='replace').readlines()
        except IOError as e:
                if e.errno not in (errno.ENOENT, errno.ESTALE):