[pygtk] shebang bug

Jorge Vargas jorge.vargas at gmail.com
Fri Nov 10 07:16:57 WST 2006


ok this is a very weird bug for some reason bonobo is thinking that my
python script is a batch script, I have been hammering my head with
this and finally got the answer.

for some days went I loaded my applet my cursos changed to a cross, I
notice this was 3 times and then it loaded which was really weird and
I had no idea what I was doing wrong (this is my first gtk program so
I was blaming it on user error). today I sat down with Sebastian
Pölsterl's suggestion and finally got the answer.

elpargo at localhost ~/pygtk/wallpaper $ /usr/local/bin/wp_thingy.py
--oaf-activate-iid=OAFIID:wallpaper_thingy_Factory --oaf-ior-fd=60
/usr/local/bin/wp_thingy.py: line 1: from: command not found
/usr/local/bin/wp_thingy.py: line 2: from: command not found
/usr/local/bin/wp_thingy.py: line 9: syntax error near unexpected token `('
/usr/local/bin/wp_thingy.py: line 9: `log = logging.getLogger("Controller")'

and the 3 times was because I had 3 import foo on that python script,
what was the cursor media-gfx/imagemagick-6.2.9.5 (/usr/bin/import)
<--- that program.

it turns out I didn't had a shebang on my second script so went the
resource is loaded by bonobo it assumes it's a shell script with C
code. the weird part is that it actually needs a shebang even though
that script is not being executed just imported.

now all this was found out by mistake since my "main" is supposed to
be wp_thingy_view.py and I just executed that script by mistake (blame
tab completion)


More information about the pygtk mailing list