Skip to content

1.7.0 breaks remote module execution #108

Description

@alfredodeza

The latest release (1.7.0) which includes the changes in this commit in particular: 544bcc8 is causing remote module execution to not work at all.

In gateway.py, this block:

        if isinstance(source, types.ModuleType):
            file_name = inspect.getsourcefile(source)
            if not file_name:
                source = inspect.getsource(source)
            else:
                source = None

Makes source always a None which is not correct. If/when commenting this source = None condition, a serialize error is raised:

  File "/tmp/bad/local/lib/python2.7/site-packages/execnet/gateway.py", line 135, in remote_exec
    gateway_base.dumps_internal((source, file_name, call_name, kwargs)))
  File "/tmp/bad/local/lib/python2.7/site-packages/execnet/gateway_base.py", line 1350, in dumps_internal
    return _Serializer().save(obj)
  File "/tmp/bad/local/lib/python2.7/site-packages/execnet/gateway_base.py", line 1368, in save
    self._save(obj)
  File "/tmp/bad/local/lib/python2.7/site-packages/execnet/gateway_base.py", line 1386, in _save
    dispatch(self, obj)
  File "/tmp/bad/local/lib/python2.7/site-packages/execnet/gateway_base.py", line 1471, in save_tuple
    self._save(item)
  File "/tmp/bad/local/lib/python2.7/site-packages/execnet/gateway_base.py", line 1384, in _save
    raise DumpError("can't serialize {}".format(tp))
execnet.gateway_base.DumpError: can't serialize <type 'module'>

I don't know what can I suggest here other than removing the optimization (as explained here 544bcc8#r310201906) since going back to 1.6 or anything previous to that commit, allows us to have a working application using remote modules

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions