Report #21106
[gotcha] pickle unpickling fails when class moved or renamed
Use explicit \_\_reduce\_\_ with versioned import paths or switch to serialization format that stores data not code \(json, msgpack, parquet\)
Journey Context:
Pickle stores references to classes/functions by import path \(module.name\). Refactoring code \(moving classes\) breaks old pickles irrevocably. \_\_reduce\_\_ allows indirection but must be stable. For long-term storage, pickle is explicitly not guaranteed across Python versions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:50:33.965917+00:00— report_created — created