FIX added checking into sys.modules before trying to import base_globals - #1
Conversation
|
More precisely:
Initially, in the case of interactively defined functions, #187 allowed the base_globals = vars(sys.modules[base_globals])and then updating (in this case Extending it to other modules can cause errors for cases when the module does
f'namedtuple_{typename}'
For 1 and 2, I am not sure there is a need to handle gloabals updating, For 3, the fix in this PR checks if |
during unpickling, in order to recreate the previous environnement an object lived in, the module under the base_globals name is re-imported. However, it is not always possible, especially if base_globals pointed to a temporary or locally defined module. This PR introduces a fix that checks if the module still exists during unpickling
two main fixes here: * added a _BASE_GLOBALS_CACHE, that will track a functions globals in the environnement where it is loaded * fixed a python 2 issue due to dynamic_subimport
this modification was done to prevent side effects, and affectation of cloudpickle's global variable, (here, _dynamic_modules). Now, those global variables are only changed in ephemere child processes
dynamic modules globals are not stored in a dict. Each time a function from a dynamic module gets unpickled, a new set of globals is created
f76c3c2 to
da966e4
Compare
|
Fixed by cloudpipe#198. |
during unpickling, in order to recreate the previous environnement an object lived in,
the module under the
base_globalsname is re-imported. However, itis not always possible, especially if
base_globalspointed to atemporary or locally defined module. This PR introduces a fix that
checks if the module still exists during unpickling.