summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-04 20:20:43 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-04 20:20:43 +0000
commit277479ba4bea43e497cbe58ff87bef16eff55ed8 (patch)
tree0a6b34f51f2e149ccc2bf25ba62da6816c25bcd0
parent353218995dd8cdb1b2b168af75835ed2091d57e5 (diff)
downloadportage-277479ba4bea43e497cbe58ff87bef16eff55ed8.tar.gz
portage-277479ba4bea43e497cbe58ff87bef16eff55ed8.tar.bz2
portage-277479ba4bea43e497cbe58ff87bef16eff55ed8.zip
Assume utf_8 encoding when reading raw ebuild metadata.
svn path=/main/trunk/; revision=13785
-rw-r--r--pym/_emerge/EbuildMetadataPhase.py4
-rw-r--r--pym/portage/__init__.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 64f54d49e..8e488d306 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -123,7 +123,9 @@ class EbuildMetadataPhase(SubProcess):
def _set_returncode(self, wait_retval):
SubProcess._set_returncode(self, wait_retval)
if self.returncode == os.EX_OK:
- metadata_lines = "".join(self._raw_metadata).splitlines()
+ metadata_lines = u''.join(unicode(chunk,
+ encoding='utf_8', errors='replace')
+ for chunk in self._raw_metadata).splitlines()
if len(portage.auxdbkeys) != len(metadata_lines):
# Don't trust bash's returncode if the
# number of lines is incorrect.
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index e601180ac..1d5a2dc02 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -6070,7 +6070,8 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
if not mybytes[-1]:
break
os.close(pr)
- mybytes = "".join(mybytes)
+ mybytes = u''.join(unicode(chunk,
+ encoding='utf_8', errors='replace') for chunk in mybytes)
global auxdbkeys
for k, v in izip(auxdbkeys, mybytes.splitlines()):
dbkey[k] = v