Python: Marshal Module's Bad Week

A single contributor, tonghuaroot, drove a cluster of fixes to serialization code, closing off crashes and data corruption bugs in the marshal and pickle machinery, while a separate wave of patches hardened concurrency edge cases across multiprocessing, asyncio, and context variables.

Duration: PT2M25S

Episode overview

This episode is a short developer briefing from Python.

It explains recent repository work in plain language.

  • Show: Python
  • Published: 2026-08-17T13:07:03Z
  • Audio duration: PT2M25S

Transcript excerpt

This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.

Good morning. It's August 17th, and today's code base tells a story about serialization safety.

The clearest pattern this cycle is a run of fixes to Python's internal marshal format, almost all from one contributor, tonghuaroot. PR 155316 fixed frozen dictionaries that appeared more than once in marshalled data, mirroring an existing fix for frozen sets. PR 151896 stopped a null pointer crash when loading a…

A second theme is concurrency correctness. PR 155478 fixed a real deadlock in multiprocessing's Pool, where closing a pool while an imap with a buffer size was in flight left a semaphore stuck and join hanging forever. PR 155943 addresses data races in the context variable watcher registry. And PR 155936, still…

A few other fixes are worth flagging: PR 155920 corrected how pickle's C implementation handles custom metaclasses, so a metaclass's attribute hook is no longer silently skipped. And PR 154843 stops zip file corruption when repack is called while a read handle is still open on an older offset.

What's next: several of these, including the metaclass pickle fix and the SMTP logging PR 155950, are still under review with open comments, so expect follow-up before they land.…

Tha…

Nearby episodes from Python

  1. The Great Attribute Deletion Bug Hunt
  2. C Attribute Setters Get a Cleanup Pass
  3. Free-Threading Hardens, Backports Sweep the Board
  4. Memory Safety Sweep in CPython Internals
  5. Weekly Recap - Data Integrity and Backport Discipline
  6. Curses Cleanup and a Wave of Correctness Fixes
  7. Free-Threading Race Conditions Take Center Stage
  8. Data Corruption Fixes and the Great Backport Sweep