diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-18 12:59:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-18 12:59:02 (GMT) |
commit | 926ce70066941193003068c44709ac04b16c0930 (patch) | |
tree | d0395d017f9373203f05b1cf7741d2321d5714f1 /Doc | |
parent | 5200f5502407045b747b97168b80d63a3cfafd4f (diff) | |
parent | 6a318d420a1512f632aa7e21a1956cfeb38b682d (diff) | |
download | cpython-926ce70066941193003068c44709ac04b16c0930.zip cpython-926ce70066941193003068c44709ac04b16c0930.tar.gz cpython-926ce70066941193003068c44709ac04b16c0930.tar.bz2 |
Merge 3.4 (marshal doc)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/marshal.rst | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Doc/c-api/marshal.rst b/Doc/c-api/marshal.rst index da402a8..9ea0aaa 100644 --- a/Doc/c-api/marshal.rst +++ b/Doc/c-api/marshal.rst @@ -53,6 +53,8 @@ written using these routines? for reading. Only a 32-bit value can be read in using this function, regardless of the native size of :c:type:`long`. + On error, raise an exception and return ``-1``. + .. c:function:: int PyMarshal_ReadShortFromFile(FILE *file) @@ -60,11 +62,15 @@ written using these routines? for reading. Only a 16-bit value can be read in using this function, regardless of the native size of :c:type:`short`. + On error, raise an exception and return ``-1``. + .. c:function:: PyObject* PyMarshal_ReadObjectFromFile(FILE *file) Return a Python object from the data stream in a :c:type:`FILE\*` opened for - reading. On error, sets the appropriate exception (:exc:`EOFError` or + reading. + + On error, sets the appropriate exception (:exc:`EOFError` or :exc:`TypeError`) and returns *NULL*. @@ -76,14 +82,17 @@ written using these routines? aggressively load file data into memory so that the de-serialization can operate from data in memory rather than reading a byte at a time from the file. Only use these variant if you are certain that you won't be reading - anything else from the file. On error, sets the appropriate exception - (:exc:`EOFError` or :exc:`TypeError`) and returns *NULL*. + anything else from the file. + + On error, sets the appropriate exception (:exc:`EOFError` or + :exc:`TypeError`) and returns *NULL*. .. c:function:: PyObject* PyMarshal_ReadObjectFromString(char *string, Py_ssize_t len) Return a Python object from the data stream in a character buffer - containing *len* bytes pointed to by *string*. On error, sets the - appropriate exception (:exc:`EOFError` or :exc:`TypeError`) and returns - *NULL*. + containing *len* bytes pointed to by *string*. + + On error, sets the appropriate exception (:exc:`EOFError` or + :exc:`TypeError`) and returns *NULL*. |