diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000000..b4ec4723a5e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## [Unreleased] + +### Changed +- Updated warning message for invalid dist-info directory due to missing `METADATA` file. diff --git a/news/12446.bugfix.rst b/news/12446.bugfix.rst new file mode 100644 index 00000000000..2335f5136e1 --- /dev/null +++ b/news/12446.bugfix.rst @@ -0,0 +1,3 @@ +* Updated warning message for invalid dist-info directory due to missing `METADATA` file. +* Added a check for the existence of the `METADATA` file in the `get_dist_canonical_name` function. +* Added a test case to verify the new warning message for a missing `METADATA` file. diff --git a/src/pip/_internal/metadata/importlib/_compat.py b/src/pip/_internal/metadata/importlib/_compat.py index 8ebf0f9b07b..e4251f58539 100644 --- a/src/pip/_internal/metadata/importlib/_compat.py +++ b/src/pip/_internal/metadata/importlib/_compat.py @@ -33,6 +33,9 @@ def name(self) -> str: def parent(self) -> "BasePath": raise NotImplementedError() + def joinpath(self, *other) -> "BasePath": + raise NotImplementedError() + def get_info_location(d: importlib.metadata.Distribution) -> Optional[BasePath]: """Find the path to the distribution's metadata directory.