Skip to content

Fix path handling and masked errors on Windows for installed-files.txt #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v6.5.1
======

* python/cpython#103661: Removed excess error suppression in
``_read_files_egginfo_installed`` and fixed path handling
on Windows.

v6.5.0
======

Expand Down
15 changes: 9 additions & 6 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,15 @@ def _read_files_egginfo_installed(self):
subdir = getattr(self, '_path', None)
if not text or not subdir:
return
with contextlib.suppress(Exception):
ret = [
str((subdir / line).resolve().relative_to(self.locate_file('')))
for line in text.splitlines()
]
return map('"{}"'.format, ret)

ret = [
(subdir / line)
.resolve()
.relative_to(self.locate_file('').resolve())
.as_posix()
for line in text.splitlines()
]
return map('"{}"'.format, ret)

def _read_files_egginfo_sources(self):
"""
Expand Down