python / python/cpython

Marshal format version: Meaning of setting a larger-than-supported version?

Open
#140,758 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

docs interpreter-core
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Documentation

Python 3.14 bumped the marshal format version to 5. Curious to find out what setting the version to 5 for earlier Python releases, I took a look at https://github.com/python/cpython/blob/main/Python/marshal.c and found that all version comparisons are [<>][=], meaning that it would be perfectly legal to set version=99 to always get the latest. Specifically, setting version=5 on Python 3.13 will also give the latest supported marshal format on that release, namely 4, without warning or error.

That seems a little funny.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the marshal documentation linked in the issue and inspect the version comparisons in Python/marshal.c. Determine the intended behavior when a caller supplies a version newer than the interpreter supports, then update the documentation or clarify the issue's expected resolution and verify the wording against the implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.