Skip to content

Commit 1d47078

Browse files
gh-139806: Mention pickle error changes in What's New in 3.14
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. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a202e5c commit 1d47078

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
@@ -3312,6 +3312,16 @@ Changes in the Python API
33123312
This temporary change affects other threads.
33133313
(Contributed by Serhiy Storchaka in :gh:`69998`.)
33143314

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

0 commit comments

Comments
 (0)