gh-120910: Fix issue resolving relative paths outside site-packages. (#120911)

Incorporates changes from importlib_metadata 7.2.1.
This commit is contained in:
Jason R. Coombs 2024-06-23 13:06:07 -04:00 committed by GitHub
parent 0b918e81c1
commit 1ba0bb21ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 1 deletions

View file

@ -567,7 +567,7 @@ class Distribution(DeprecatedNonAbstract):
paths = (
(subdir / name)
.resolve()
.relative_to(self.locate_file('').resolve())
.relative_to(self.locate_file('').resolve(), walk_up=True)
.as_posix()
for name in text.splitlines()
)