Skip to content

Add more tests for pickle and fix error messages #122311

Closed

Description

@serhiy-storchaka

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    testsTests in the Lib/test dir
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    on Jul 26, 2024
  2. added 2 commits that reference this issue on Jul 26, 2024
  3. added 2 commits that reference this issue on Jul 26, 2024
  4. added 4 commits that reference this issue on Jul 26, 2024
  5. 15 remaining items

  6. added 3 commits that reference this issue on Jul 29, 2024
  7. added 2 commits that reference this issue on Jul 29, 2024
  8. added 2 commits that reference this issue on Jul 29, 2024
  9. added 2 commits that reference this issue on Aug 7, 2024
  10. added a commit that references this issue on Sep 9, 2024
  11. added 3 commits that reference this issue on Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.12only security fixes3.13only security fixes3.14bugs and security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions