ladon-ctl missing Python shebang or extension

Bug #1187658 reported by André
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ladon
Undecided
Unassigned

Bug Description

I'm running ladon 0.8.1 under Ubuntu 12.04, virtualenv and Python 2.7.3 and I had an issue running the ladon-ctl test server.
It's missing the Python shebang or extension. See trace below:
(testproject) $ ladon-ctl
from: can't read /var/mail/os.path
from: can't read /var/mail/optparse
/home/andre/Progz/testproject/bin/ladon-ctl: line 5: import: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 7: commands: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 8: testserve:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 9: desc:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 10: options:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 11: -p:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 12: help:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 13: metavar:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 14: dest:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 15: type:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 16: default:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 17: },: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 18: -v:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 19: help:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 20: metavar:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 21: dest:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 22: type:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 23: default:: command not found
/home/andre/Progz/testproject/bin/ladon-ctl: line 24: syntax error near unexpected token `}'
/home/andre/Progz/testproject/bin/ladon-ctl: line 24: ` }'
(testproject) $

Related branches

Revision history for this message
paolinux79 (paolo-bert-w) wrote :

I usually type:

python `which ladon-ctl` testserve.......

;P

Revision history for this message
Carlos Roberto Freire (carlosrobertofreire) wrote :

I have the same problem.

André, how do you fixed this?

Thanks, best regards.

Revision history for this message
André (andre-miras) wrote :

Either use what @paolinux79 gave just above your post or edit the ladon-ctl file to add the Python shebang. Google it to understand how it works.

Revision history for this message
Carlos Roberto Freire (carlosrobertofreire) wrote :

Thanks, André!

Revision history for this message
Pavel Savchenko (asfaltboy) wrote :

Not sure how to suggest a patch/pullrequest in Launchpad, but this is generally accepted to use the #!/usr/bin/env python shebang for an executable python script, and it works in a virtualenv.

For a more explicit definition it is possible to detect the python (i.e `which python`) during the package's setup.py. For example have a look at sphinx's setup.py (the setuptools's entry_points clause modifies the generic shebang to point to the actual python interpreter path). For more info on this technique see here: http://matthew-brett.github.io/pydagogue/installing_scripts.html

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers