diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-15 19:18:12 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-15 19:18:12 -0400 |
commit | 83a4a2a389f0bc0eee32c578dd7bda64c4f3e18b (patch) | |
tree | 986bd33abdf0b44ede7469945e3351952841d10d /coverage/files.py | |
parent | 78fa8c3bf90fdf64397565cad64846dc6807e21b (diff) | |
download | python-coveragepy-git-83a4a2a389f0bc0eee32c578dd7bda64c4f3e18b.tar.gz |
A file opened in 'b' mode needs bytes, not strings. Try to do this in a clean-ish way...
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/coverage/files.py b/coverage/files.py index 9a8ac564..a68a0a7f 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 |