On this page
pickle.load
Prev: pickle.dumps | Up: pickle | Next: pickle.loads
Rel: pickle.dump, pickle.dumps, pickle.loads, pickle.PickleBuffer
Ref: docs.python.org — pickle.load
Tags: #public #python3 #stdlib #pickle
Import
import pickle
from pickle import load
Signature & Overview
pickle.load(file, *, fix_imports=True, encoding='ASCII', errors='strict', buffers=())
Read and return an object from the pickle data stored in a file.
Usage
import io
import pickle
buf = io.BytesIO(pickle.dumps([10, 20]))
assert pickle.load(buf) == [10, 20]
Gotchas
- Binary mode (
"rb") only and trusted sources only.
REPL Inspect
from pickle import load
help(load)
Linked from
- tuts/python3/stdlib_module/pickle
- tuts/python3/stdlib_module/pickle/dump
- tuts/python3/stdlib_module/pickle/dumps
- tuts/python3/stdlib_module/pickle/loads
- tuts/python3/stdlib_module/pickle/PickleBuffer
- tuts/python3/stdlib_module/pickle/PickleError
- tuts/python3/stdlib_module/pickle/Pickler
- tuts/python3/stdlib_module/pickle/PicklingError
- tuts/python3/stdlib_module/pickle/Unpickler
- tuts/python3/stdlib_module/pickle/UnpicklingError
Related notes
- tuts/python3/stdlib_module/pickle/dump Linked here; links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/dumps Linked here; links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/loads Linked here; links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/PickleBuffer Linked here; links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/pickle/PickleError links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/Pickler links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/PicklingError links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/Unpickler links to this page; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/UnpicklingError links to this page; shared tags: #pickle, #stdlib