Repository navigation
Commit 9abb861
fix: re-wire pickle __getstate__ for descriptor-backed attrs
_CachedUnionMember stores prefixes/titles/etc. under a leading-underscore
private name (_prefixes, _titles, …). The previous __getstate__ filtered
out everything starting with '_', so those four attrs were silently dropped
from every pickle. __setstate__ then had nothing to restore and accessed the
class-level descriptor object rather than a SetManager.
Fix: map '_xxx' back to 'xxx' when the attr is a _CachedUnionMember, so
__setstate__ receives the public name and can restore through the descriptor,
re-wiring _on_change callbacks in the process.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c7018c8 commit 9abb861
1 file changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
368 | 377 | | |
369 | 378 | | |
370 | 379 | | |
| |||
0 commit comments