I discovered that loading code objects created by higher order functions of the form
def make_fun(val):
def func(_):
return val
return func
and pickled using cloudpickle in Python 3.7, can't be loaded back up again with load() in Python 3.8. I think this also affected dill (uqfoundation/dill#357).
A fix is suggested by one of the CPython devs here: python/cpython#12701 (comment)
This would mean making a fallback to pickle.load which is used.
I'm filing this issue so other people can see, this might be an example of why pickling for long term storage is not recommended.