diff --git a/python/pip_install/extract_wheels/lib/wheel.py b/python/pip_install/extract_wheels/lib/wheel.py index fadf8af436..3803fba9ce 100644 --- a/python/pip_install/extract_wheels/lib/wheel.py +++ b/python/pip_install/extract_wheels/lib/wheel.py @@ -55,9 +55,12 @@ def entry_points(self) -> Dict[str, str]: # Calculate the location of the entry_points.txt file metadata = self.metadata name = "{}-{}".format(metadata.name.replace("-", "_"), metadata.version) - entry_points_path = os.path.join( - "{}.dist-info".format(name), "entry_points.txt" - ) + # Note that the zipfile module always uses the forward slash as + # directory separator, even on Windows, so don't use os.path.join + # here. Reference for Python 3.10: + # https://github.com/python/cpython/blob/3.10/Lib/zipfile.py#L355. + # TODO: use zipfile.Path once 3.8 is our minimum supported version + entry_points_path = "{}.dist-info/entry_points.txt".format(name) # If this file does not exist in the wheel, there are no entry points if entry_points_path not in whl.namelist():