https://docs.python.org/3/library/pickle.html#restricting-globals
Author: Rebecca N. Palmer
Forwarded: https://github.com/statsmodels/statsmodels/pull/6162
Gbp-Pq: Name cache_security.patch
@classmethod
def load(cls, fname):
"""
- load a pickle, (class method)
+ load a pickle, (class method); use only on trusted files,
+ as unpickling can run arbitrary code.
Parameters
----------
@classmethod
def load(cls, fname):
+ """Load a pickled instance; use only on trusted files,
+ as unpickling can run arbitrary code."""
from statsmodels.iolib.smpickle import load_pickle
return load_pickle(fname)
def load_pickle(fname):
"""
- Load a previously saved object from file
+ Load a previously saved object; **use only on trusted files**,
+ as unpickling can run arbitrary code. (i.e. calling this on a
+ malicious file can wipe or take over your system.)
Parameters
----------