Closed
Description
Bug report
Much error generating code in the pickle
module is not tested at all. As result, not only exception types and messages can differ between Python and C implementations, but other bugs are left unnoticed:
- NameError in formatting one of error messages.
- "Can't pickle" in the error message during unpickling.
- Error message including the repr of wrong object.
- Some errors are only detected in one of implementations (Python or C).
- Crash in untested corner case (Crash after error in PickleBuffer #122306).
I am going to add more tests and fix the most odious errors. This will be backported to 3.12 and 3.13, but the backport to 3.12 will have more lenient variants of tests. Late, I will unify and improve other error messages (this is for main only).
Linked PRs
- gh-122311: Fix typo in the pickle error formatting code #122312
- [3.13] gh-122311: Fix typo in the pickle error formatting code (GH-122312) #122314
- [3.12] gh-122311: Fix typo in the pickle error formatting code (GH-122312) #122315
- gh-122311: Add more tests for pickle (strict) #122373
- gh-122311: Add more tests for pickle (lenient) #122376
- [3.13] gh-122311: Add more tests for pickle (GH-122376) #122377
- [3.12] gh-122311: Add more tests for pickle (GH-122376) #122378
- gh-122311: Fix some error messages in pickle #122386
- [3.13] gh-122311: Fix some error messages in pickle (GH-122386) #122387
- [3.12] gh-122311: Fix some error messages in pickle (GH-122386) #122388
- gh-122311: Fix a refleak in pickle #122411
- [3.13] gh-122311: Fix a refleak in pickle (GH-122411) #122415
- [3.12] gh-122311: Fix a refleak in pickle (GH-122411) #122416
- gh-122311: Improve and unify pickle errors #122771
Metadata
Metadata
Assignees
Labels
only security fixesonly security fixesbugs and security fixesbugs and security fixesbugs and security fixesbugs and security fixesTests in the Lib/test dirTests in the Lib/test dirAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done