uv
9d55baf2 - Pad with zeros during comparisons in `EqualStar` and `NotEqualStar` operators (#17751)

Commit
18 days ago
Pad with zeros during comparisons in `EqualStar` and `NotEqualStar` operators (#17751) This is a bug that was found by fuzzing with Claude > The `==X.Y.*` and `!=X.Y.*` operators use `zip` to compare version > components, but `zip` stops at the shorter iterator. This caused > short versions to incorrectly match longer prefix specifiers. > > For example, version "2" (which is semantically "2.0") would > incorrectly match "==2.1.*" because the `zip` would only compare > the first component (2 == 2) and never check the second component. > > The fix pads the version with zeros when it's shorter than the > specifier prefix, matching PEP 440's normalization semantics where > trailing zeros are implied. Co-authored-by: Claude <noreply@anthropic.com>
Author
Parents
Loading