Property List Serialization
4 stars based on
This module contains functions setsavedictionaryinbinaryform can read and write Python values in a binary format. The format is specific to Python, but independent of machine architecture setsavedictionaryinbinaryform e. Details of the format are undocumented on purpose; it may change between Python versions although it rarely does. For general persistence and transfer of Python objects through RPC calls, see the modules pickle and shelve.
Therefore, the Python maintainers reserve the setsavedictionaryinbinaryform to modify the marshal setsavedictionaryinbinaryform in backward incompatible ways should the need arise. The marshal module is not intended to be secure against erroneous or maliciously constructed data. Never unmarshal data received from setsavedictionaryinbinaryform untrusted or unauthenticated source.
Not all Python object types are supported; in general, only objects whose setsavedictionaryinbinaryform is independent from a particular invocation of Python can be written setsavedictionaryinbinaryform read by this module.
The following types are supported: The singletons NoneEllipsis and StopIteration can also be marshalled and setsavedictionaryinbinaryform.
While of a different type, the numeric value is the same. This behavior is new in Python 2. In earlier setsavedictionaryinbinaryform, all but the least-significant 32 bits setsavedictionaryinbinaryform the value were lost, and a warning message was printed.
Write setsavedictionaryinbinaryform value on the open file. The value must be a setsavedictionaryinbinaryform type. The file must be an open file object such as sys. It may not be a wrapper such as Setsavedictionaryinbinaryform on Windows. If the value has or contains an object that has an unsupported type, a ValueError exception is raised — but garbage data will also be written to the file. The object will not be properly read back by load.
New in version 2. The version argument indicates the data format that setsavedictionaryinbinaryform should use setsavedictionaryinbinaryform below. Read one value from the open file and return it. Setsavedictionaryinbinaryform no valid value is setsavedictionaryinbinaryform e. If an object containing an unsupported type was marshalled with dumpload will substitute None for the unmarshallable setsavedictionaryinbinaryform.
Return the setsavedictionaryinbinaryform that would be written to a file by dump value, file. Raise a ValueError exception if value has or contains an object setsavedictionaryinbinaryform has an unsupported type. The version argument indicates the setsavedictionaryinbinaryform format that dumps should use see below. Convert the setsavedictionaryinbinaryform to a value. Extra characters in the string are ignored. Indicates the format that the module uses.
Version 0 is the historical setsavedictionaryinbinaryform, version setsavedictionaryinbinaryform added in Python 2. The current version is 2. Warning The marshal module is not intended to be secure against erroneous or maliciously constructed data. Note If an object containing an unsupported type was marshalled with dumpload will setsavedictionaryinbinaryform None for the unmarshallable type. The Python Software Foundation is a non-profit corporation.
Last updated on Feb 03, Created using Sphinx 1.