Skip to content

Commit

Permalink
pythongh-105184: document that marshal functions can fail and need to…
Browse files Browse the repository at this point in the history
… be checked with PyErr_Occurred
  • Loading branch information
iritkatriel committed Jun 1, 2023
1 parent 7f5afec commit 212c72e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Doc/c-api/marshal.rst
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.
.. 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.
.. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)
Expand Down

0 comments on commit 212c72e

Please sign in to comment.