Skip to content

Commit bbc7021

Browse files
authored
Merge pull request #10537 from pradyunsg/fix-misbehaving-test
2 parents ebc13b4 + 4cdf146 commit bbc7021

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pip/_internal/index/package_finder.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from pip._internal.utils.misc import build_netloc
3838
from pip._internal.utils.packaging import check_requires_python
3939
from pip._internal.utils.unpacking import SUPPORTED_EXTENSIONS
40-
from pip._internal.utils.urls import url_to_path
4140

4241
__all__ = ["FormatControl", "BestCandidateResult", "PackageFinder"]
4342

@@ -816,7 +815,14 @@ def find_all_candidates(self, project_name: str) -> List[InstallationCandidate]:
816815
)
817816

818817
if logger.isEnabledFor(logging.DEBUG) and file_candidates:
819-
paths = [url_to_path(c.link.url) for c in file_candidates]
818+
paths = []
819+
for candidate in file_candidates:
820+
assert candidate.link.url # we need to have a URL
821+
try:
822+
paths.append(candidate.link.file_path)
823+
except Exception:
824+
paths.append(candidate.link.url) # it's not a local file
825+
820826
logger.debug("Local files found: %s", ", ".join(paths))
821827

822828
# This is an intentional priority ordering

0 commit comments

Comments
 (0)