aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py2
-rw-r--r--pkg_resources/tests/test_pkg_resources.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 3ae2c5cd..2b2442f5 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2228,7 +2228,7 @@ 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.normpath(os.path.realpath(filename)))
def _normalize_cached(filename, _cache={}):
diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py
index 62a39b8f..81b67a31 100644
--- a/pkg_resources/tests/test_pkg_resources.py
+++ b/pkg_resources/tests/test_pkg_resources.py
@@ -236,3 +236,8 @@ class TestDeepVersionLookupDistutils:
req = pkg_resources.Requirement.parse('foo>=1.9')
dist = pkg_resources.WorkingSet([env.paths['lib']]).find(req)
assert dist.version == version
+
+ def test_normalize_path(self, tmpdir):
+ path = str(tmpdir)
+ expected = os.path.normcase(os.path.normpath(os.path.realpath(path)))
+ assert pkg_resources.normalize_path(path) == expected