Visitar URL original
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred by iritkatriel · Pull Request #105185 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-105184: document that marshal functions can fail and need to be ch…
…ecked with PyErr_Occurred
  • Loading branch information
iritkatriel committed Jun 1, 2023
commit 212c72eddd98429e534df4b44a07eb283dde2581
4 changes: 4 additions & 0 deletions Doc/c-api/marshal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ unmarshalling. Version 2 uses a binary format for floating point numbers.
the least-significant 32 bits of *value*; regardless of the size of the
native :c:expr:`long` type. *version* indicates the file format.

This function can fail, in which case it sets the error indicator.
Use ``PyErr_Occurred()`` to check for that.
Comment thread
iritkatriel marked this conversation as resolved.
Outdated

.. c:function:: void PyMarshal_WriteObjectToFile(PyObject *value, FILE *file, int version)

Marshal a Python object, *value*, to *file*.
*version* indicates the file format.

This function can fail, in which case it sets the error indicator.
Use ``PyErr_Occurred()`` to check for that.
Comment thread
iritkatriel marked this conversation as resolved.
Outdated

.. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)

Expand Down