diff options
-rw-r--r-- | pym/portage/tests/ebuild/test_array_fromfile_eof.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/portage/tests/ebuild/test_array_fromfile_eof.py b/pym/portage/tests/ebuild/test_array_fromfile_eof.py index 8eacb406b..eebf0234c 100644 --- a/pym/portage/tests/ebuild/test_array_fromfile_eof.py +++ b/pym/portage/tests/ebuild/test_array_fromfile_eof.py @@ -18,9 +18,10 @@ class ArrayFromfileEofTestCase(TestCase): # http://bugs.python.org/issue5334 input_data = "an arbitrary string" + input_bytes = _unicode_encode(input_data, + encoding='utf_8', errors='strict') f = tempfile.TemporaryFile() - f.write(_unicode_encode(input_data, - encoding='utf_8', errors='strict')) + f.write(input_bytes) f.seek(0) data = [] @@ -28,7 +29,7 @@ class ArrayFromfileEofTestCase(TestCase): while not eof: a = array.array('B') try: - a.fromfile(f, len(input_data) + 1) + a.fromfile(f, len(input_bytes) + 1) except EOFError: # python-3.0 lost data here eof = True |