summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/marshal.rst
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-06-02 07:59:18 (GMT)
committerGitHub <noreply@github.com>2023-06-02 07:59:18 (GMT)
commitee26ca13a129da8cf549409d0a1b2e892ff2b4ec (patch)
tree77aefc5286e6c2fa6b0c653c2123c25a51a49f84 /Doc/c-api/marshal.rst
parent77d25795862f19c6e3d647b76cfb10d5ce1f149c (diff)
downloadcpython-ee26ca13a129da8cf549409d0a1b2e892ff2b4ec.zip
cpython-ee26ca13a129da8cf549409d0a1b2e892ff2b4ec.tar.gz
cpython-ee26ca13a129da8cf549409d0a1b2e892ff2b4ec.tar.bz2
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (#105185)
Diffstat (limited to 'Doc/c-api/marshal.rst')
-rw-r--r--Doc/c-api/marshal.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/c-api/marshal.rst b/Doc/c-api/marshal.rst
index 8e25968..489f158 100644
--- a/Doc/c-api/marshal.rst
+++ b/Doc/c-api/marshal.rst
@@ -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 :c:func:`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 :c:func:`PyErr_Occurred` to check for that.
.. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)