Tutorial A one-line rename in Python 3.15 broke loading of every old pickle
Python 3.15's new sentinel() comes back from a pickle as the same object, which the old object() idiom never did. The catch: it does this by saving its name. Rename MISSING to UNSET and every file saved earlier fails to load.
I wrote up why it happens and the one-line fix: https://www.tk1s.com/python/python-sentinel-rename-breaks-pickle
0
Upvotes
16
u/really_not_unreal 1h ago
Me when the breaking changes cause breakages.
As per the documentation:
Pickle is a system for serialisation, and while it works for persistence to some extent, it is not ideal for this. The documentation warns about requiring access to the same data structures in order to unpickle them. In essence: you shouldn't be expecting things like this to work. You should instead use the right tool for the job: a database.
19
u/amarao_san 1h ago
Slop.
•
u/Individual-Flow9158 24m ago edited 17m ago
Yet another reason to be glad I've never gone anywhere near
picklewith a barge pole.Who on earth is still using pickle in 2026, FFS?
Oh.