Skip to content

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

@nschloe

Description

@nschloe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions