Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1152bd1

Browse filesBrowse files
authored
Fix entry point discovery on Windows. (bazel-contrib#572)
The zipfile module always uses forward slashes, so we shouldn't use os.path.join here.
1 parent 661d527 commit 1152bd1
Copy full SHA for 1152bd1

File tree

1 file changed

+6
-3
lines changed
Filter options
  • python/pip_install/extract_wheels/lib

1 file changed

+6
-3
lines changed

‎python/pip_install/extract_wheels/lib/wheel.py

Copy file name to clipboardExpand all lines: python/pip_install/extract_wheels/lib/wheel.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ def entry_points(self) -> Dict[str, str]:
5555
# Calculate the location of the entry_points.txt file
5656
metadata = self.metadata
5757
name = "{}-{}".format(metadata.name.replace("-", "_"), metadata.version)
58-
entry_points_path = os.path.join(
59-
"{}.dist-info".format(name), "entry_points.txt"
60-
)
58+
# Note that the zipfile module always uses the forward slash as
59+
# directory separator, even on Windows, so don't use os.path.join
60+
# here. Reference for Python 3.10:
61+
# https://github.com/python/cpython/blob/3.10/Lib/zipfile.py#L355.
62+
# TODO: use zipfile.Path once 3.8 is our minimum supported version
63+
entry_points_path = "{}.dist-info/entry_points.txt".format(name)
6164

6265
# If this file does not exist in the wheel, there are no entry points
6366
if entry_points_path not in whl.namelist():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.