Commit 24aa787
fix: pickled HumanName keeps multi-word suffix entries intact
__setstate__ restored components by joining each pickled *_list into one
string and letting replace() re-split it on whitespace. That destroyed
the entry boundaries: suffix_list ["Ph. D."] came back as ["Ph.", "D."],
and the suffix view's ", " join then rendered one credential as two.
Build tokens per entry instead, tagging continuation words "joined" --
the inverse of _list_for's heal -- so list -> pickle -> list is the
identity again.
This was a regression against 1.4.0, not an inherited quirk: all eight
affected corpus names round-trip unchanged under a live 1.4.0, and now
match it byte for byte. 8 of the 486 differential-corpus names drifted
before the fix (any multi-word suffix run in one comma segment: "Jr. MD",
"Q.C. M.P.", "V Jr.", "MD PhD - FACS Fellow"); 0 drift after, checking
str(), as_dict() and all six _list attributes.
The differential harness could not have caught this -- it compares fresh
v1 and 2.0 parses and never crosses a pickle boundary.
Note the list SETTER (_set_field) splits the same way on purpose: 1.4.0
also renders hn.suffix = ["Ph. D.", "MD"] as "Ph., D., MD", so that path
is v1 parity and is deliberately left alone.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 08cfeb5 commit 24aa787
2 files changed
Lines changed: 51 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
675 | 674 | | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
310 | 343 | | |
311 | 344 | | |
312 | 345 | | |
| |||
0 commit comments