[Pythonmac-SIG] weird #! problem

Russell E. Owen rowen at cesmail.net
Fri Feb 20 15:47:22 EST 2004


I am trying to make an easy-to-use build script and have stumbled across 
a very strange thing. Here is a minimal version of the script:

script buildtui.py:
#!/usr/bin/python
import sys, bundlebuilder
if len(sys.argv) == 1:
    sys.argv.append('build')
bundlebuilder.buildapp(....)

What I observe is if I run this script this way:
% /usr/bin/python buildtui.py
it works just fine. But if I run it this way:
./buildtui.py
it fails. It *appears* to work (the output looks the same, and from 
poking around in the bundle the resulting app looks the same, but the 
resulting app fails with the following message in the Console:

Fatal Python error: Interpreter not initialized (version mismatch?)

I can't imagine how my build script can even tell the difference between 
the two means of execution. But I've confirmed this multiple times with 
variant scripts.

Any idea what may be happening and what to do about it?

I hope I'm not overlooking something really obvious, but I've put 
diagnostic printout in the script and I just can't see anything going on 
that is different. One thing I've not done is a byte-by-byte comparison 
of the two resulting applications.

-- Russell




More information about the Pythonmac-SIG mailing list