def load(fh, encoding, is_verbose=True):
    """
    Load a pickle, with a provided encoding,

    Parameters
    ----------
    fh : a filelike object
    encoding : an optional encoding
    is_verbose : show exception output
    """
    try:
        if encoding is not None:
            return pickle.load(fh)
        else:
            return pickle.load(fh, encoding=encoding)
    except Exception:
        try:
            fh.seek(0)
            return _load(fh, encoding=encoding)
        except Exception as ex:
            try:
                fh.seek(0)
                if encoding is not None:
                    up = Unpickler2(fh, encoding=encoding)
                else:
                    up = Unpickler2(fh)
                up.is_verbose = is_verbose

                return up.load()
            except Exception:
                raise ex
Load a pickle, with a provided encoding,

Parameters
----------
fh : a filelike object
encoding : an optional encoding
is_verbose : show exception output
jqdatasdk/compat/pickle_compat.py