Commit d0b88ac9 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #1335 from themiwi/patch-1

Adds call to os.path.abspath() in pkg_resources.normalize_path() on Cygwin
parents d6d9da82 c14b6f35
In ``pkg_resources.normalize_path``, fix issue on Cygwin when cwd contains symlinks.
......@@ -2228,7 +2228,18 @@ register_namespace_handler(object, null_ns_handler)
def normalize_path(filename):
"""Normalize a file/dir name for comparison purposes"""
return os.path.normcase(os.path.realpath(filename))
return os.path.normcase(os.path.realpath(_cygwin_patch(filename)))
def _cygwin_patch(filename): # pragma: nocover
"""
Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
symlink components. Using
os.path.abspath() works around this limitation. A fix in os.getcwd()
would probably better, in Cygwin even more so, except
that this seems to be by design...
"""
return os.path.abspath(filename) if sys.platform == 'cygwin' else filename
def _normalize_cached(filename, _cache={}):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment