summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/ebuild/test_spawn.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/tests/ebuild/test_spawn.py')
-rw-r--r--pym/portage/tests/ebuild/test_spawn.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/portage/tests/ebuild/test_spawn.py b/pym/portage/tests/ebuild/test_spawn.py
index 1ba6e5847..908fce606 100644
--- a/pym/portage/tests/ebuild/test_spawn.py
+++ b/pym/portage/tests/ebuild/test_spawn.py
@@ -2,7 +2,13 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import errno, os, sys
+import codecs
+import errno
+import sys
+from portage import os
+from portage import _content_encoding
+from portage import _fs_encoding
+from portage import _unicode_encode
from portage.tests import TestCase
class SpawnTestCase(TestCase):
@@ -27,7 +33,9 @@ class SpawnTestCase(TestCase):
spawn("echo -n '%s'" % test_string, settings, logfile=logfile,
free=1, fd_pipes={0:sys.stdin.fileno(), 1:null_fd, 2:null_fd})
os.close(null_fd)
- f = open(logfile, 'r')
+ f = codecs.open(_unicode_encode(logfile,
+ encoding=_fs_encoding, errors='strict'),
+ mode='r', encoding=_content_encoding, errors='strict')
log_content = f.read()
f.close()
# When logging passes through a pty, this comparison will fail