Skip to content

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

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

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

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>
@bedevere-app bedevere-app Bot added awaiting review docs Documentation in the Doc dir skip news labels Oct 11, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Oct 11, 2026
@gpshead
gpshead enabled auto-merge (squash) October 11, 2026 21:52
@gpshead
gpshead merged commit f8a48fb into python:3.14 Oct 11, 2026
37 of 38 checks passed
@miss-islington
miss-islington deleted the backport-b3714a5-3.14 branch October 11, 2026 21:59
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