From 581381acffbedfdc553b9643d47924bf44e32238 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 20 Jul 2009 23:50:20 +0000 Subject: Always pass encodings='utf_8' to codecs.open(), since otherwise it can return non-unicode strings (at least in some cases, observed with python-2.6.2). Don't use unicode in portage.util.getconfig() for now, since shlex doesn't seem to support it (spurious \0 characters). If we use unicode for config variables, it breaks shlex.split() calls on those variables due to the same issue (spurious \0 characters). svn path=/main/trunk/; revision=13845 --- pym/portage/env/loaders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pym/portage/env') diff --git a/pym/portage/env/loaders.py b/pym/portage/env/loaders.py index 7cd2600ae..7b4d72721 100644 --- a/pym/portage/env/loaders.py +++ b/pym/portage/env/loaders.py @@ -139,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 = codecs.open(fn, mode='r', errors='replace') + f = codecs.open(fn, mode='r', encoding='utf_8', errors='replace') for line_num, line in enumerate(f): func(line, line_num, data, errors) return (data, errors) -- cgit v1.2.3-1-g7c22