Old pickles break
known regression: old-pickles-fail-to-loadVersion("0")The PR removes the `_structures` module and its `Infinity`/`NegativeInfinity` sentinel classes, which were used in the comparison key (`_cmpkey`) of `Version` objects. Pickled `Version` objects from the old version may contain references to these sentinel classes in their cached `_key_cache`. Unpickling them in the new version fails with `ModuleNotFoundError` because the module no longer exists. This is an unintended regression for users who rely on pickling `Version` objects across versions; the PR presents itself as a performance refactor and does not mention pickling compatibility in tests,
-@typing.final-class InfinityType:Found by: project's test strings, hostile mutation · also caught by: Mutations of the PR's own test strings
ran onToken Factory Sandboxes · image e7fbcc0c-cc99-4f27-9713-ec040778674e
Regression test verified passes on base, errors on head
def test_1116_p4_base_head_load_0():
"""Breakwater P4: base behaviour pinned (found by differential testing; label: likely-bug)."""
import base64
import pickle
# pickled by the base version (lazy caches warmed first)
old = pickle.loads(base64.b64decode('gASVygAAAAAAAACMEXBhY2thZ2luZy52ZXJzaW9ulIwHVmVyc2lvbpSTlCmBlE59lCiMBF9kZXaUTowGX2Vwb2NolEsAjApfa2V5X2NhY2hllChLACmMFXBhY2thZ2luZy5fc3RydWN0dXJlc5SMDEluZmluaXR5VHlwZZSTlCmBlGgIjBROZWdhdGl2ZUluZmluaXR5VHlwZZSTlCmBlGgLaA50lIwGX2xvY2FslE6MBV9wb3N0lE6MBF9wcmWUTowIX3JlbGVhc2WUSwCFlHWGlGIu'))
assert old is not None # loading must not raise
Reproduce
uv run breakwater probe --repo https://github.com/pypa/packaging --base baa9ea8c7fa7 --head f2bbd4f57864 --target packaging.version:Version --backend contree --input "0"