summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-14 23:44:14 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-14 23:44:14 +0000
commita7da3bd50c8863d7b6b6d101df763ae64de35097 (patch)
tree2f4cc957a19aa5a2c5b9758e5aad9563abbbe911 /bin/repoman
parentRevert tar error handling changes from bug #309001 since we can't necessarily (diff)
downloadportage-idfetch-a7da3bd50c8863d7b6b6d101df763ae64de35097.tar.gz
portage-idfetch-a7da3bd50c8863d7b6b6d101df763ae64de35097.tar.bz2
portage-idfetch-a7da3bd50c8863d7b6b6d101df763ae64de35097.zip
Bug #299095 - Always use UTF-8 codec when opening ebuilds, to avoid
UnicodeDecodeError with python3. svn path=/main/trunk/; revision=15828
Diffstat (limited to 'bin/repoman')
-rwxr-xr-xbin/repoman7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/repoman b/bin/repoman
index a6ae9a08..26ca6e36 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2314,7 +2314,9 @@ else:
from portage.util import write_atomic
cvs_header = re.compile(r'^#\s*\$Header.*\$$')
for x in myheaders:
- f = open(x)
+ f = codecs.open(_unicode_encode(x,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'], errors='strict')
mylines = f.readlines()
f.close()
modified = False
@@ -2323,7 +2325,8 @@ else:
mylines[i] = line.replace("/Attic/", "/")
modified = True
if modified:
- write_atomic(x, "".join(mylines))
+ write_atomic(x, "".join(mylines),
+ encoding=_encodings['repo.content'], errors='strict')
manifest_commit_required = True
if vcs in ('cvs', 'svn') and (myupdates or myremoved):