P1Output changed
known regression: unicode-lowercase
inputcanonicalize_name("İ")
basevalue: "i̇"
headvalue: "İ"
Likely bugvotes: 3 likely-bug
The PR aims only to speed up canonicalize_name while preserving the original semantics (lower‑casing per PEP 503). The new implementation only lower‑cases ASCII letters, so non‑ASCII characters like ‘İ’ are not lower‑cased, changing the output.
Emulates ``re.sub(r
perf: translate for canonicalize_name
Found by: Nemotron strategy search, Ultra's planned example, hostile mutation, search sample · also caught by: Plain Hypothesis, Mutations of the PR's own test strings, Nemotron plan only
ran onlocal Docker · image bw-pair:d09088ff31a7e098
Regression test verified passes on base, fails on head
def test_1030_p1_value_0():
"""Breakwater P1: base behaviour pinned (found by differential testing; label: likely-bug)."""
from packaging.utils import canonicalize_name
assert canonicalize_name('İ') == 'i̇'
Reproduce
uv run breakwater probe --repo https://github.com/pypa/packaging --base 52e57f20037f --head 3803ce341b59 --target packaging.utils:canonicalize_name --backend docker --input "İ"
2 near-duplicate classes same behaviour, inputs with extra traits
canonicalize_name("İ ") base value: "i̇ " · head value: "İ "unicode-lowercase test verifiedcanonicalize_name("İ\u0000") base value: "i̇\u0000" · head value: "İ\u0000"unicode-lowercase test verified
P2Exception behaviour changed
inputcanonicalize_name(["İ"])
baseraises TypeError
headraises AttributeError
Neither exception type subclasses the other.
Likely bugvotes: 3 likely-bug
The change introduces a different exception type (AttributeError vs TypeError) when processing the same input, which is not mentioned in the PR title, docs, or tests and therefore is an unintended regression.
perf: translate for canonicalize_name
Emulates ``re.sub(r
Found by: Nemotron strategy search, search sample · no baseline found it
ran onlocal Docker · image bw-pair:d09088ff31a7e098
Regression test verified passes on base, errors on head
def test_1030_p2_outcome_3():
"""Breakwater P2: base behaviour pinned (found by differential testing; label: likely-bug)."""
import pytest
from packaging.utils import canonicalize_name
with pytest.raises(TypeError) as excinfo:
canonicalize_name(['İ'])
assert type(excinfo.value) is TypeError # exact type: a subclass would be a behaviour change
P3Equality / ordering changed
acanonicalize_name("İ")
bcanonicalize_name("py3")
basea > b → False
heada > b → True
Likely bugvotes: 3 likely-bug
Ordering changes because the new code no longer lower‑cases Unicode letters, so comparison results differ from the original specification that required ``.lower()``.
Emulates ``re.sub(r
perf: translate for canonicalize_name
Found by: Ultra's planned example, relations pass · also caught by: Plain Hypothesis, Nemotron plan only
ran onlocal Docker · image bw-pair:d09088ff31a7e098
Regression test verified passes on base, fails on head
def test_1030_p3_gt_4():
"""Breakwater P3: base behaviour pinned (found by differential testing; label: likely-bug)."""
from packaging.utils import canonicalize_name
a = canonicalize_name('İ')
b = canonicalize_name('py3')
assert (a > b) is False
3 near-duplicate relation flipes same behaviour, inputs with extra traits
canonicalize_name("İ") vs canonicalize_name("py3") base a < b → True · head a < b → False test verifiedcanonicalize_name("ẞ") vs canonicalize_name("K") base a > b → True · head a > b → False test verifiedcanonicalize_name("ẞ") vs canonicalize_name("K") base a < b → False · head a < b → True test verified