The pickling of local function from a module is broken on python3.4. This seems to be related to #205
The way to reproduce that is having 2 files in the same directory and launching the later command line.
mk_dynamic.py
deff():
defg():
returnsum(range(10))
returng
main.py
frommk_dynamicimportffromcloudpickleimportdumpsprint(dumps(f()))
And then calling the pickled function with the following command line
python -c "from cloudpickle import loads; g = loads($(python main.py)); print(g())"
The given output is
Traceback (mostrecentcalllast):
File"<string>", line1, in<module>File"/home/tom/Work/prog/stackoverflow/bug_cloudpickle_builtins/mk_nobuiltin.py", line5, ingreturnsum(range(10))
KeyError: 'sum'
The pickling of local function from a module is broken on
python3.4. This seems to be related to #205The way to reproduce that is having 2 files in the same directory and launching the later command line.
mk_dynamic.py
main.py
And then calling the pickled function with the following command line
The given output is