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
2df5d97f
Commit
2df5d97f
authored
Aug 13, 2020
by
Jason R. Coombs
Committed by
GitHub
Aug 13, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2153 from pypa/bugfix/2129-better-egg-detection
Stricter egg detection
parents
a7f6ad46
9372bf7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
changelog.d/2129.change.rst
changelog.d/2129.change.rst
+1
-0
pkg_resources/__init__.py
pkg_resources/__init__.py
+14
-3
No files found.
changelog.d/2129.change.rst
0 → 100644
View file @
2df5d97f
In pkg_resources, no longer detect any pathname ending in .egg as a Python egg. Now the path must be an unpacked egg or a zip file.
pkg_resources/__init__.py
View file @
2df5d97f
...
...
@@ -2056,7 +2056,10 @@ def find_on_path(importer, path_item, only=False):
)
return
entries = safe_listdir(path_item)
entries = (
os.path.join(path_item, child)
for child in safe_listdir(path_item)
)
# for performance, before sorting by version,
# screen entries for only those that will yield
...
...
@@ -2372,7 +2375,15 @@ def _is_egg_path(path):
"""
Determine if given path appears to be an egg.
"""
return path.lower().endswith('.egg')
return _is_zip_egg(path) or _is_unpacked_egg(path)
def _is_zip_egg(path):
return (
path.lower().endswith('.egg') and
os.path.isfile(path) and
zipfile.is_zipfile(path)
)
def _is_unpacked_egg(path):
...
...
@@ -2380,7 +2391,7 @@ def _is_unpacked_egg(path):
Determine if given path appears to be an unpacked egg.
"""
return (
_is_egg_path(path
) and
path.lower().endswith('.egg'
) and
os.path.isfile(os.path.join(path, 'EGG-INFO', 'PKG-INFO'))
)
...
...
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