Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:whatsnew-3.14-pickle-errors
Jul 19, 2026
Merged

gh-139806: Mention pickle error changes in What's New in 3.14#154020
serhiy-storchaka merged 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.

@serhiy-storchaka
serhiy-storchaka merged commit eb44708 into python:main Jul 19, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 19, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the whatsnew-3.14-pickle-errors branch July 19, 2026 15:20
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154161 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 19, 2026
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154162 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 19, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 19, 2026
…H-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>
serhiy-storchaka added a commit that referenced this pull request Jul 19, 2026
…H-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants