GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add more tests for pickle and fix error messages · Issue #122311 · python/cpython

Add more tests for pickle and fix error messages #122311

New issue
Copy link
New issue
Copy link
Closed
Closed
Add more tests for pickle and fix error messages#122311
Copy link
Assignees
serhiy-storchaka
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@serhiy-storchaka
serhiy-storchaka
opened on Jul 26, 2024
Issue body actions

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

Activity

Next
  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    3.12only security fixesonly security fixes
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    on Jul 26, 2024
  2. serhiy-storchaka
    added this to Pickle and copy issues 🥒on Jul 26, 2024
  3. serhiy-storchaka
    self-assigned this
    on Jul 26, 2024
  4. serhiy-storchaka
    added 2 commits that reference this issue on Jul 26, 2024

    pythongh-122311: Fix typo in the pickle error formatting code

    9a68845

    gh-122311: Fix typo in the pickle error formatting code (GH-122312)

    7c29218
  5. miss-islington
    added 2 commits that reference this issue on Jul 26, 2024

    pythongh-122311: Fix typo in the pickle error formatting code (python…

    f1bafd4

    pythongh-122311: Fix typo in the pickle error formatting code (python…

    1ee84b5
  6. serhiy-storchaka
    added 4 commits that reference this issue on Jul 26, 2024

    [3.12] gh-122311: Fix typo in the pickle error formatting code (GH-12…

    7353106

    [3.13] gh-122311: Fix typo in the pickle error formatting code (GH-12…

    816a157

    pythongh-122311: Add more tests for pickle

    8e31ad0

    pythongh-122311: Add more tests for pickle

    5233d92
  7. 15 remaining items

  8. serhiy-storchaka
    added 3 commits that reference this issue on Jul 29, 2024

    gh-122311: Add more tests for error messages in pickle (GH-122373)

    0697188

    pythongh-122311: Fix a refleak in pickle

    885e945

    gh-122311: Fix a refleak in pickle (GH-122411)

    68840e9
  9. miss-islington
    added 2 commits that reference this issue on Jul 29, 2024

    pythongh-122311: Fix a refleak in pickle (pythonGH-122411)

    c7bc40f

    pythongh-122311: Fix a refleak in pickle (pythonGH-122411)

    4993303
  10. serhiy-storchaka
    added 2 commits that reference this issue on Jul 29, 2024

    [3.12] gh-122311: Fix a refleak in pickle (GH-122411) (GH-122416)

    bad8497

    [3.13] gh-122311: Fix a refleak in pickle (GH-122411) (GH-122415)

    d8701e2
  11. serhiy-storchaka
    added 2 commits that reference this issue on Aug 7, 2024

    pythongh-122311: Improve and unify pickle errors

    554abbc

    pythongh-122311: Improve and unify pickle errors

    43d94f2
  12. serhiy-storchaka
    added a commit that references this issue on Sep 9, 2024

    gh-122311: Improve and unify pickle errors (GH-122771)

    b2a8c38
  13. serhiy-storchaka
    closed this as completedon Sep 9, 2024
  14. github-project-automation
    moved this to Done in Pickle and copy issues 🥒on Sep 9, 2024
  15. serhiy-storchaka
    added 3 commits that reference this issue on Jul 19, 2026

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

    eb44708

    [3.15] gh-139806: Mention pickle error changes in What's New in 3.14 (G…

    52e7302

    [3.14] gh-139806: Mention pickle error changes in What's New in 3.14 (G…

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

Metadata

Metadata

Assignees

  • @serhiy-storchaka
    serhiy-storchaka

Labels

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

Projects

  • Pickle and copy issues 🥒
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.