diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-07-26 22:51:26 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-07-26 22:51:26 -0400 |
commit | a2c2e4365a9f1dde956319d5bc75bff6eef7ddfd (patch) | |
tree | 112f9339e7b6a76320eddba3249803794499634d /coverage/files.py | |
parent | 5c98172ff46513e182196b59b2b432b416ce2010 (diff) | |
download | python-coveragepy-a2c2e4365a9f1dde956319d5bc75bff6eef7ddfd.tar.gz |
Windows fixes due to data changes
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/files.py b/coverage/files.py index bc9b0c9..e3ebd6c 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -12,6 +12,7 @@ import re import sys from coverage import env +from coverage.backward import unicode_class from coverage.misc import CoverageException, join_regex @@ -73,6 +74,8 @@ if env.WINDOWS: def actual_path(path): """Get the actual path of `path`, including the correct case.""" + if env.PY2 and isinstance(path, unicode_class): + path = path.encode(sys.getfilesystemencoding()) if path in _ACTUAL_PATH_CACHE: return _ACTUAL_PATH_CACHE[path] @@ -84,7 +87,7 @@ if env.WINDOWS: actpath = tail else: head = actual_path(head) - if head in _ACTUAL_PATH_LIST_CACHE: + if head in _ACTUAL_PATH_LIST_CACHE: files = _ACTUAL_PATH_LIST_CACHE[head] else: try: |