remote_exec breaks inspect.stack() assumptions

Issue #15 on hold
Peter Feiner
created an issue

inspect.stack() assumes that file names contain at least one character:

(venv)peter@gremlin:~/workspace/execnet$ cat
import execnet
gw = execnet.makegateway()
c = gw.remote_exec('import inspect; inspect.stack();')
(venv)peter@gremlin:~/workspace/execnet$ python
Traceback (most recent call last):
  File "", line 4, in <module>
  File "/home/peter/workspace/execnet/execnet/", line 412, in waitclose
    raise error
execnet.gateway_base.RemoteError: Traceback (most recent call last):
  File "/home/peter/workspace/execnet/execnet/", line 800, in executetask
    do_exec(co, loc)
  File "<string>", line 1, in do_exec
  File "", line 1, in <module>
  File "/usr/lib/python2.7/", line 1054, in stack
    return getouterframes(sys._getframe(1), context)
  File "/usr/lib/python2.7/", line 1032, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/usr/lib/python2.7/", line 1007, in getframeinfo
    lines, lnum = findsource(frame)
  File "/usr/lib/python2.7/", line 528, in findsource
    if not sourcefile and file[0] + file[-1] != '<>':
IndexError: string index out of range

I'll submit a pull request momentarily.

Comments (5)

  1. Log in to comment