summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-20 17:50:07 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-20 17:50:07 +0000
commitdd0bd38bd9648387b6cae69540d9bfd2cac87d75 (patch)
tree6cc3ba8d6474f1efafca27a444f1b24af8b240ad
parentf6d93d581534ada8914eeb5d88cd3aba94e3a06e (diff)
downloadportage-dd0bd38bd9648387b6cae69540d9bfd2cac87d75.tar.gz
portage-dd0bd38bd9648387b6cae69540d9bfd2cac87d75.tar.bz2
portage-dd0bd38bd9648387b6cae69540d9bfd2cac87d75.zip
Use codecs.open for unicode support in FileLoader.load().
svn path=/main/trunk/; revision=13836
-rw-r--r--pym/portage/env/loaders.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/env/loaders.py b/pym/portage/env/loaders.py
index 31d3b09aa..7cd2600ae 100644
--- a/pym/portage/env/loaders.py
+++ b/pym/portage/env/loaders.py
@@ -3,6 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
+import codecs
import os
import stat
from portage.localization import _
@@ -138,7 +139,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)
+ f = codecs.open(fn, mode='r', errors='replace')
for line_num, line in enumerate(f):
func(line, line_num, data, errors)
return (data, errors)