Restore Constants pickle migration shim, correct its version history#211
Merged
Conversation
The shim in Constants.__setstate__ that skips the legacy suffixes_prefixes_titles property key (needed to load pickles written before the #167 getstate/setstate rewrite) was removed with a commit message claiming "1.2.1 shipped with a compatibility shim." That's incorrect: diffing v1.2.0..v1.2.1 shows zero changes to this file, and the shim was only ever added/removed within the unreleased 1.3.0 branch. There is no 1.2.1-era shim to bridge through. Restore the shim (and its regression test) so pickles from any released version through 1.2.1 load directly under 1.3.0+, with comments correctly attributing it to 1.3.0. Remove the release_log.rst upgrade note describing a nonexistent "upgrade to 1.2.1 first" path, since it's no longer needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Constants.__setstate__migration shim that skips the legacysuffixes_prefixes_titlesproperty key found in pickles written before the#167__getstate__/__setstate__rewrite.git diff v1.2.0 v1.2.1 -- nameparser/config/__init__.pyshows no changes, so there was never a "1.2.1 pickle shim" to bridge through — the shim was only ever added and removed within the unreleased 1.3.0 branch.docs/release_log.rstupgrade note describing a nonexistent "upgrade to 1.2.1 first" migration path, since the restored shim makes old pickles (any version through 1.2.1) load directly under 1.3.0+.test_unpickle_legacy_state_with_property_keyintests/test_constants.py.Test plan
python -m pytest tests/test_constants.py -k "pickle or unpickle" -v— 10 passedpython -m pytest tests/ -q— 1264 passed, 4 skipped, 22 xfailed🤖 Generated with Claude Code