Skip to content

Commit

Permalink
Merge pull request pypa#8926 from uranusjr/dont-crash-on-check
Browse files Browse the repository at this point in the history
Don't crash on 'check' when METADATA is missing
  • Loading branch information
pradyunsg committed Oct 16, 2020
1 parent a025993 commit cb9ccf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions news/8676.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improve error message friendliness when an environment has packages with
corrupted metadata.
4 changes: 2 additions & 2 deletions src/pip/_internal/operations/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def create_package_set_from_installed(**kwargs):
name = canonicalize_name(dist.project_name)
try:
package_set[name] = PackageDetails(dist.version, dist.requires())
except RequirementParseError as e:
# Don't crash on broken metadata
except (OSError, RequirementParseError) as e:
# Don't crash on unreadable or broken metadata
logger.warning("Error parsing requirements for %s: %s", name, e)
problems = True
return package_set, problems
Expand Down

0 comments on commit cb9ccf6

Please sign in to comment.