We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f60e8b1 commit 52cb80cCopy full SHA for 52cb80c
src/pip/_internal/models/link.py
@@ -47,6 +47,11 @@ class LinkHash:
47
value: str
48
49
_hash_re = re.compile(
50
+ # NB: we do not validate that the second group (.*) is a valid hex
51
+ # digest. Instead, we simply keep that string in this class, and then check it
52
+ # against Hashes when hash-checking is needed. This is easier to debug than
53
+ # proactively discarding an invalid hex digest, as we handle incorrect hashes
54
+ # and malformed hashes in the same place.
55
r"({choices})=(.*)".format(
56
choices="|".join(re.escape(hash_name) for hash_name in _SUPPORTED_HASHES)
57
),
0 commit comments