Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from pickle import loads; loads(payload) # don't do it...!
File "...\lib\pickle.py", line 1388, in loads
return Unpickler(file).load()
File "...\lib\pickle.py", line 864, in load
dispatch[key](self)
File "...\lib\pickle.py", line 1139, in load_reduce
value = func(*args)
ValueError: bad marshal data (unknown type code)
A pickle bytestring can execute completely arbitrary code. I have used them in my work.
An easy introduction: https://www2.cs.uic.edu/~s/musings/pickle/
An example:
(p.s., a matplotlib core dev told me they may move away from their use of pickle for this very reason.)