Skip to content

Commit 52e7302

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.15] gh-139806: Mention pickle error changes in What's New in 3.14 (GH-154020) (GH-154161)
The gh-122311 changes made pickle.dump() and pickle.dumps() raise PicklingError for some failures that previously raised AttributeError, ImportError, ValueError or UnicodeEncodeError, depending on the implementation. Add an entry about this in the "Porting to Python 3.14" section. (cherry picked from commit eb44708) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 618f4ec commit 52e7302

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Doc/whatsnew/3.14.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3310,6 +3310,16 @@ Changes in the Python API
33103310
This temporary change affects other threads.
33113311
(Contributed by Serhiy Storchaka in :gh:`69998`.)
33123312

3313+
* :func:`pickle.dump` and :func:`pickle.dumps` now raise
3314+
:exc:`~pickle.PicklingError` for some failures that previously raised
3315+
:exc:`AttributeError`, :exc:`ImportError`, :exc:`ValueError`,
3316+
:exc:`UnicodeEncodeError` or :exc:`!PicklingError`,
3317+
depending on the implementation
3318+
(for example, pickling a local object, or an object whose module cannot be imported).
3319+
The original exception is chained to the :exc:`!PicklingError`.
3320+
Code that caught these exceptions should also catch :exc:`!PicklingError`.
3321+
(Contributed by Serhiy Storchaka in :gh:`122311`.)
3322+
33133323
* :class:`types.UnionType` is now an alias for :class:`typing.Union`,
33143324
causing changes in some behaviors.
33153325
See :ref:`above <whatsnew314-typing-union>` for more details.

0 commit comments

Comments
 (0)