Home
last modified time | relevance | path

Searched refs:pickle (Results 1 – 25 of 228) sorted by relevance

12345678910

/third_party/python/Doc/library/
Dpickletools.rst1 :mod:`pickletools` --- Tools for pickle developers
5 :synopsis: Contains extensive comments about the pickle protocols and
6 pickle-machine opcodes, as well as some useful functions.
14 :mod:`pickle` module, some lengthy comments about the implementation, and a
16 are useful for Python core developers who are working on the :mod:`pickle`;
17 ordinary users of the :mod:`pickle` module probably won't find the
26 disassemble the contents of one or more pickle files. Note that if
27 you want to see the Python object stored in the pickle rather than the
28 details of pickle format, you may want to use ``-m pickle`` instead.
29 However, when the pickle file that you want to examine comes from an
[all …]
Dcopyreg.rst1 :mod:`copyreg` --- Register :mod:`pickle` support functions
5 :synopsis: Register pickle support functions.
10 module: pickle
16 specific objects. The :mod:`pickle` and :mod:`copy` modules use those functions
28 .. function:: pickle(type, function, constructor=None)
39 See the :mod:`pickle` module for more details on the interface
41 :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler
42 object or subclass of :class:`pickle.Pickler` can also be used for
48 The example below would like to show how to register a pickle function and how
51 >>> import copyreg, copy, pickle
[all …]
Dpickle.rst1 :mod:`pickle` --- Python object serialization
4 .. module:: pickle
10 **Source code:** :source:`Lib/pickle.py`
22 The :mod:`pickle` module implements binary protocols for serializing and
33 The ``pickle`` module **is not secure**. Only unpickle data you trust.
35 It is possible to construct malicious pickle data which will **execute
53 general :mod:`pickle` should always be the preferred way to serialize Python
57 The :mod:`pickle` module differs from :mod:`marshal` in several significant ways:
59 * The :mod:`pickle` module keeps track of the objects it has already serialized,
68 serialized. :mod:`pickle` stores such objects only once, and ensures that all
[all …]
Dsecurity_warnings.rst20 * :mod:`multiprocessing`: :ref:`Connection.recv() uses pickle
21 <multiprocessing-recv-pickle-security>`
22 * :mod:`pickle`: :ref:`Restricting globals in pickle <pickle-restrict>`
25 * :mod:`shelve`: :ref:`shelve is based on pickle and thus unsuitable for
Dshelve.rst9 .. index:: module: pickle
15 arbitrary Python objects --- anything that the :mod:`pickle` module can handle.
28 By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used
29 to serialize values. The version of the pickle protocol can be specified
45 :data:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle
61 Because the :mod:`shelve` module is backed by :mod:`pickle`, it is insecure
62 to load a shelf from an untrusted source. Like with pickle, loading a shelf
119 By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used
120 to serialize values. The version of the pickle protocol can be specified
121 with the *protocol* parameter. See the :mod:`pickle` documentation for a
[all …]
/third_party/python/Lib/test/
Dtest_pickletools.py1 import pickle
11 return pickletools.optimize(pickle.dumps(arg, proto, **kwargs))
14 return pickle.loads(buf, **kwds)
25 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
26 pickled = pickle.dumps(data, proto)
27 unpickled = pickle.loads(pickled)
32 unpickled2 = pickle.loads(pickled2)
35 self.assertNotIn(pickle.LONG_BINGET, pickled2)
36 self.assertNotIn(pickle.LONG_BINPUT, pickled2)
53 self.assertIn(pickle.BINPUT, pickled)
[all …]
Dtest_pickle.py4 import pickle
36 dump = staticmethod(pickle._dump)
37 dumps = staticmethod(pickle._dumps)
38 load = staticmethod(pickle._load)
39 loads = staticmethod(pickle._loads)
40 Pickler = pickle._Pickler
41 Unpickler = pickle._Unpickler
46 unpickler = pickle._Unpickler
48 truncated_errors = (pickle.UnpicklingError, EOFError,
60 pickler = pickle._Pickler
[all …]
Dtest_list.py4 import pickle
84 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
87 d = pickle.dumps((itorig, orig), proto)
88 it, a = pickle.loads(d)
95 d = pickle.dumps((itorig, orig), proto)
96 it, a = pickle.loads(d)
104 d = pickle.dumps((itorig, orig), proto)
105 it, a = pickle.loads(d)
112 d = pickle.dumps((itorig, orig), proto)
113 it, a = pickle.loads(d)
[all …]
Dpickletester.py8 import pickle
35 from pickle import bytes_types
53 protocols = range(pickle.HIGHEST_PROTOCOL + 1)
57 def opcode_in_pickle(code, pickle): argument
58 for op, dummy, dummy in pickletools.genops(pickle):
64 def count_opcode(code, pickle): argument
66 for op, dummy, dummy in pickletools.genops(pickle):
207 return type(self)._reconstruct, (pickle.PickleBuffer(self),), None
235 return type(self)._reconstruct, (pickle.PickleBuffer(self),), None
312 pb = pickle.PickleBuffer(self.array)
[all …]
Dtest_sndhdr.py2 import pickle
31 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
32 dump = pickle.dumps(what, proto)
33 self.assertEqual(pickle.loads(dump), what)
Dtest_xml_dom_minicompat.py4 import pickle
88 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
91 pickled = pickle.dumps(node_list, proto)
92 unpickled = pickle.loads(pickled)
99 pickled = pickle.dumps(node_list, proto)
100 unpickled = pickle.loads(pickled)
Dtest_tuple.py5 import pickle
350 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
352 d = pickle.dumps(itorg, proto)
353 it = pickle.loads(d)
357 it = pickle.loads(d)
359 d = pickle.dumps(it, proto)
364 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
366 d = pickle.dumps(itorg, proto)
367 it = pickle.loads(d)
371 it = pickle.loads(d)
[all …]
Dtest_iter.py8 import pickle
89 def check_iterator(self, it, seq, pickle=True): argument
90 if pickle:
102 def check_for_loop(self, expr, seq, pickle=True): argument
103 if pickle:
112 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
113 d = pickle.dumps(itorg, proto)
114 it = pickle.loads(d)
121 it = pickle.loads(d)
126 d = pickle.dumps(it, proto)
[all …]
Dtest_configparser.py1702 import pickle
1704 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1705 pickled = pickle.dumps(e1, proto)
1706 e2 = pickle.loads(pickled)
1711 import pickle
1713 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1714 pickled = pickle.dumps(e1, proto)
1715 e2 = pickle.loads(pickled)
1722 import pickle
1724 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
[all …]
Dtest_dict.py4 import pickle
1108 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1111 d = pickle.dumps(it, proto)
1112 it = pickle.loads(d)
1115 it = pickle.loads(d)
1120 d = pickle.dumps(it, proto)
1121 it = pickle.loads(d)
1126 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1130 d = pickle.dumps(itorg, proto)
1131 it = pickle.loads(d)
[all …]
/third_party/python/Lib/test/test_email/
Dtest_pickleable.py4 import pickle
33 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
34 p = pickle.dumps(header, proto)
35 h = pickle.loads(p)
69 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
70 p = pickle.dumps(msg, proto)
71 msg2 = pickle.loads(p)
/third_party/boost/libs/mpi/src/python/
Dserialize.cpp19 struct pickle::data_t {
27 pickle::data_t* pickle::data;
29 object pickle::dumps(object obj, int protocol) in dumps()
35 object pickle::loads(object s) in loads()
41 void pickle::initialize_data() in initialize_data()
/third_party/boost/libs/python/doc/reference/
Dpickle.qbk5 …alternative approach is to use Python's pickle module. Exploiting Python's ability for introspecti…
7 …e pickle module through the interface as described in detail in the [@https://docs.python.org/2/li…
10 At the user level, the Boost.Python pickle interface involves three special methods:
14 If `__getinitargs__` is not defined, `pickle.load` will call the constructor (`__init__`) without a…
16 …tance of a `Boost.Python` extension class is restored by the unpickler (`pickle.load`), it is firs…
22 There are three files in `python/test` that show how to provide pickle support.
24 …te argument to the constructor. Therefore it is sufficient to define the pickle interface method `…
25 Definition of the C++ pickle function:
46 …ore it is necessary to provide the `__getstate__`/`__setstate__` pair of pickle interface methods:
48 Definition of the C++ pickle functions:
[all …]
/third_party/python/Lib/lib2to3/pgen2/
Dgrammar.py16 import pickle
90 pickle.dump(self.__dict__, f, pickle.HIGHEST_PROTOCOL)
95 d = pickle.load(f)
100 self.__dict__.update(pickle.loads(pkl))
/third_party/python/Lib/unittest/test/testmock/
Dtestsentinel.py3 import pickle
29 for proto in range(pickle.HIGHEST_PROTOCOL+1):
31 pickled = pickle.dumps(sentinel.whatever, proto)
32 unpickled = pickle.loads(pickled)
/third_party/python/Doc/includes/
Ddbpickle.py4 import pickle
11 class DBPickler(pickle.Pickler):
26 class DBUnpickler(pickle.Unpickler):
46 raise pickle.UnpicklingError("unsupported persistent object")
/third_party/grpc/src/python/grpcio_tests/tests/unit/
D_auth_context_test.py16 import pickle
55 return pickle.dumps({
78 auth_data = pickle.loads(response)
103 auth_data = pickle.loads(response)
139 auth_data = pickle.loads(response)
153 auth_data = pickle.loads(response)
/third_party/boost/libs/gil/doc/
DMakefile16 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf …
57 pickle: target
58 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
/third_party/boost/libs/python/doc/numpy/
DMakefile16 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf …
57 pickle: target
58 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
/third_party/grpc/src/python/grpcio_tests/tests_aio/unit/
Dauth_context_test.py16 import pickle
56 return pickle.dumps({
79 auth_data = pickle.loads(response)
104 auth_data = pickle.loads(response)
140 auth_data = pickle.loads(response)
154 auth_data = pickle.loads(response)

12345678910