From 786ddc82a22314ebaa93f0f63a54fd443d09812e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 15 Mar 2011 19:18:12 -0400 Subject: A file opened in 'b' mode needs bytes, not strings. Try to do this in a clean-ish way... --- coverage/files.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'coverage/files.py') diff --git a/coverage/files.py b/coverage/files.py index 9a8ac56..a68a0a7 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -1,5 +1,6 @@ """File wrangling.""" +from coverage.backward import to_string import fnmatch, os, sys class FileLocator(object): @@ -72,9 +73,7 @@ class FileLocator(object): data = zi.get_data(parts[1]) except IOError: continue - if sys.version_info >= (3, 0): - data = data.decode('utf8') # TODO: How to do this properly? - return data + return to_string(data) return None -- cgit v1.2.1