Skip to content

[3.15] gh-159185: Document that PyMarshal_WriteObjectToFile can silently truncate before 3.16 (GH-159201) - #159202

Merged
gpshead merged 1 commit into
python:3.15from
miss-islington:backport-b3714a5-3.15
Oct 11, 2026
Merged

gpshead merged 1 commit into
python:3.15from
miss-islington:backport-b3714a5-3.15

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

gh-159185: Document that the PyMarshal file writers can fail silently before 3.16

In Python 3.15 and earlier, PyMarshal_WriteObjectToFile() ignores most
marshalling errors and all I/O errors: it returns without setting the
error indicator after writing only part of the data.
PyMarshal_WriteLongToFile() ignores I/O errors in the same way. That
was fixed in 3.16 by gh-155907, which is not backported. Tell the users
of the older versions so that they can check what was written.
(cherry picked from commit b3714a5)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com

…ly truncate before 3.16 (pythonGH-159201)

pythongh-159185: Document that the PyMarshal file writers can fail silently before 3.16

In Python 3.15 and earlier, PyMarshal_WriteObjectToFile() ignores most
marshalling errors and all I/O errors: it returns without setting the
error indicator after writing only part of the data.
PyMarshal_WriteLongToFile() ignores I/O errors in the same way.  That
was fixed in 3.16 by pythongh-155907, which is not backported.  Tell the users
of the older versions so that they can check what was written.
(cherry picked from commit b3714a5)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
@read-the-docs-community

Copy link
Copy Markdown

@gpshead
gpshead merged commit 9ad8605 into python:3.15 Oct 11, 2026
39 checks passed
@miss-islington
miss-islington deleted the backport-b3714a5-3.15 branch October 11, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants