Trouble with and zsh script (OSError: [Errno 8] Exec format error)

Rob Wolfe rw at
Sun Nov 11 21:25:55 CET 2007

Michael  George Lerner <mglerner at> writes:

> Hi,
> (Python 2.5, OS X 10.4.10)
> I have a program called pdb2pqr on my system. It is installed so that
> "pdb2pqr" is in my path and looks like:
> #\!/bin/zsh -f

Are you sure that this shebang is correct?

I've tested that on bash and have similar error:


echo "t1"

>>> from subprocess import call
>>> call(['./'])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/", line 413, in call
    return Popen(*args, **kwargs).wait()
  File "/usr/lib/python2.4/", line 543, in __init__
    errread, errwrite)
  File "/usr/lib/python2.4/", line 975, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

But running that directly through the shell works:

>>> call(['./'], shell=True)

However this script works fine also without `shell=True` option:


echo "t2"

>>> call(['./'])


More information about the Python-list mailing list