Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
84f1abaf
Commit
84f1abaf
authored
Oct 24, 2018
by
Tzu-ping Chung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call os.path.normpath to normalize paths for comp
parent
8c22c3b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
changelog.d/1519.change.rst
changelog.d/1519.change.rst
+1
-0
pkg_resources/__init__.py
pkg_resources/__init__.py
+1
-1
pkg_resources/tests/test_pkg_resources.py
pkg_resources/tests/test_pkg_resources.py
+5
-0
No files found.
changelog.d/1519.change.rst
0 → 100644
View file @
84f1abaf
Perform additional path normalization to ensure path values to a directory is always the same, preventing false positives when checking scripts have a consistent prefix to set up on Windows.
pkg_resources/__init__.py
View file @
84f1abaf
...
...
@@ -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={}):
...
...
pkg_resources/tests/test_pkg_resources.py
View file @
84f1abaf
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment