summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-21 01:47:21 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-21 01:47:21 +0000
commit023fb84c4aa6bc1d36202ed6617cc2c77d0dc27d (patch)
tree3d2a414deccad97c1f8adb501a27e88e259c856a
parent3c40a733c8713c2db2debe18e1a638fc23296571 (diff)
downloadportage-023fb84c4aa6bc1d36202ed6617cc2c77d0dc27d.tar.gz
portage-023fb84c4aa6bc1d36202ed6617cc2c77d0dc27d.tar.bz2
portage-023fb84c4aa6bc1d36202ed6617cc2c77d0dc27d.zip
Use _encodings where appropriate.
svn path=/main/trunk/; revision=14109
-rw-r--r--pym/portage/dbapi/porttree.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 56ed44945..34e9d178e 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -26,8 +26,9 @@ from portage.manifest import Manifest
from portage import eclass_cache, auxdbkeys, doebuild, flatten, \
listdir, dep_expand, eapi_is_supported, key_expand, dep_check, \
_eapi_is_deprecated
-from portage import _unicode_encode
from portage import os
+from portage import _encodings
+from portage import _unicode_encode
import codecs
import logging
@@ -172,8 +173,10 @@ class portdbapi(dbapi):
repo_name_path = os.path.join(path, REPO_NAME_LOC)
try:
repo_name = codecs.open(
- _unicode_encode(repo_name_path), mode='r',
- encoding='utf_8', errors='replace').readline().strip()
+ _unicode_encode(repo_name_path,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'],
+ errors='replace').readline().strip()
except EnvironmentError:
# warn about missing repo_name at some other time, since we
# don't want to see a warning every time the portage module is
@@ -621,8 +624,10 @@ class portdbapi(dbapi):
if eapi is None and \
'parse-eapi-ebuild-head' in self.doebuild_settings.features:
eapi = portage._parse_eapi_ebuild_head(codecs.open(
- _unicode_encode(myebuild), mode='r',
- encoding='utf_8', errors='replace'))
+ _unicode_encode(myebuild,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'],
+ errors='replace'))
if eapi is not None:
self.doebuild_settings.configdict['pkg']['EAPI'] = eapi