PyDocs

Nav

Data Persistence

load

marshal

function
  • load(file, /, *, allow_code=True)
Read one value from the open file and return it.

  file
    Must be readable binary file.
  allow_code
    Allow to load code objects.

If no valid value is read (e.g. because the data has a different Python
version's incompatible marshal format), raise EOFError, ValueError or
TypeError.

Note: If an object containing an unsupported type was marshalled with
dump(), load() will substitute None for the unmarshallable type.
Changed in 3.10, 3.13
  • 3.10: This call used to raise a code.__new__ audit event for each code object. Now it raises a single marshal.load event for the entire load operation.
  • 3.13: Added the allow_code parameter.
0 Examples
No examples for marshal/load.
See Also
No see-alsos for marshal/load
0 Notes
No notes for load