Skip to content

Commit dfd4214

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.14] gh-139806: Mention pickle error changes in What's New in 3.14 (GH-154020) (GH-154162)
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 1933f77 commit dfd4214

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

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

0 commit comments

Comments
 (0)