Skip to content

gh-139806: Mention pickle error changes in What's New in 3.14#154020

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:whatsnew-3.14-pickle-errors
Open

gh-139806: Mention pickle error changes in What's New in 3.14#154020
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:whatsnew-3.14-pickle-errors

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 18, 2026

Copy link
Copy Markdown
Member

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.

The pythongh-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>
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

@picnixz, I added a "Porting to Python 3.14" entry on your request. Is it fine to you?

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33648028 | 📁 Comparing 1d47078 against main (a202e5c)

  🔍 Preview build  

1 file changed
± whatsnew/3.14.html

@picnixz

picnixz commented Jul 18, 2026

Copy link
Copy Markdown
Member

I think it's good enough to keep them here. The full changelog is quite long and it's easy to miss this kind of change. I should however say that I didn't consistently mention those changes in this section but pickle is quite used so I believe it's good to have this. Thanks!

Comment thread Doc/whatsnew/3.14.rst
Comment on lines +3316 to +3319
:exc:`~pickle.PicklingError` for some failures that previously raised
:exc:`AttributeError`, :exc:`ImportError`, :exc:`ValueError`,
:exc:`UnicodeEncodeError` or :exc:`!PicklingError`,
depending on the implementation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit confusing to say that we raise PicklingError instead of... previously PicklingError. I think you can omit the second PicklingError.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep it for correctness. Depending on implementation, different types were raised, including PicklingError. And this was inconsistent -- for one kind of error you could get PicklingError in C and AttributeError in Python, for other -- UnicodeEncodeError in C and PicklingError in Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants