On this page
pickle.UnpicklingError
Prev: pickle.Unpickler | Up: pickle
Rel: pickle.dump, pickle.dumps, pickle.load, pickle.loads
Ref: docs.python.org โ pickle.UnpicklingError
Tags: #public #python3 #stdlib #pickle
Import
import pickle
from pickle import UnpicklingError
Signature & Overview
pickle.UnpicklingError(...)
pickle.UnpicklingError class.
Methods & Attributes
UnpicklingError.add_note(self, note, /)โ Add a note to the exceptionUnpicklingError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import pickle
try:
pickle.loads(b"not valid pickle")
except (pickle.UnpicklingError, ValueError, EOFError):
assert True
Gotchas
- Corrupt pickles can also raise
EOFError,ValueError, orAttributeError, not onlyUnpicklingError.
REPL Inspect
from pickle import UnpicklingError
help(UnpicklingError)
Linked from
Related notes
- tuts/python3/stdlib_module/pickle/Unpickler 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/dump Linked here; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/dumps Linked here; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/load Linked here; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/loads Linked here; shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/PickleBuffer shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/PickleError shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/Pickler shared tags: #pickle, #stdlib
- tuts/python3/stdlib_module/pickle/PicklingError shared tags: #pickle, #stdlib