Skip to content

Restore Constants pickle migration shim, correct its version history#211

Merged
derek73 merged 1 commit into
masterfrom
fix/restore-pickle-migration-shim
Jul 4, 2026
Merged

Restore Constants pickle migration shim, correct its version history#211
derek73 merged 1 commit into
masterfrom
fix/restore-pickle-migration-shim

Conversation

@derek73

@derek73 derek73 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restore the Constants.__setstate__ migration shim that skips the legacy suffixes_prefixes_titles property key found in pickles written before the #167 __getstate__/__setstate__ rewrite.
  • Correct the shim's comments and the removal commit's mistaken premise: git diff v1.2.0 v1.2.1 -- nameparser/config/__init__.py shows 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.
  • Remove the docs/release_log.rst upgrade 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+.
  • Restore test_unpickle_legacy_state_with_property_key in tests/test_constants.py.

Test plan

  • python -m pytest tests/test_constants.py -k "pickle or unpickle" -v — 10 passed
  • python -m pytest tests/ -q — 1264 passed, 4 skipped, 22 xfailed

🤖 Generated with Claude Code

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>
@derek73 derek73 self-assigned this Jul 4, 2026
@derek73 derek73 added bug docs Documentation fixes and updates labels Jul 4, 2026
@derek73 derek73 merged commit c4ac7e4 into master Jul 4, 2026
8 checks passed
@derek73 derek73 deleted the fix/restore-pickle-migration-shim branch July 4, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug docs Documentation fixes and updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant