Opened 15 years ago

Closed 15 years ago

#21528 closed defect (worksforme)

python26 2.6.2_4: scripts installed with distutils have incorrect hashbang

Reported by: dackze+macports@… Owned by: blb@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: python Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: python26

Description

Scripts installed using setup.py install incorrectly have a hashbang of #!/usr/bin/python:

$ which python
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python
$ python_select -s
python26
$ head -1 scripts/dnuos 
#!/usr/bin/env python
$ sudo python setup.py install
running install
running build
running build_py
copying dnuos/locale/fr/LC_MESSAGES/dnuos.mo -> build/lib/dnuos/locale/fr/LC_MESSAGES
running build_scripts
running build_mo
running install_lib
creating /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/dnuos
[...]
running install_scripts
copying build/scripts-2.6/dnuos -> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
changing mode of /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/dnuos to 755
running install_egg_info
Writing /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/dnuos-1.0.10-py2.6.egg-info
$ head -1 `which dnuos`
#!/usr/bin/python

The hashbang should read #!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python.

I'm not sure if this affects other Python ports.

Change History (4)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Cc: blb@… removed
Owner: changed from macports-tickets@… to blb@…

comment:2 Changed 15 years ago by blb@…

I can't reproduce this here; if I run

/opt/local/bin/python2.6 setup.py install --root=/tmp/destroot

the dnuos script has a proper shebang line:

#!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
import sys
import dnuos
...

Also, creating a Portfile for dnuos, installing it shows the same shebang; I added the port in r58095 if you want to try that to see what happens.

comment:3 Changed 15 years ago by dackze+macports@…

I'm not able to reproduce it now either. I think I may have forgotten to delete the build directory after upgrading python_select to the current version, so it was installing the old busted version anyway.

You can mark this as invalid.

comment:4 Changed 15 years ago by blb@…

Resolution: worksforme
Status: newclosed

Good to hear it's working, but if you do find how to reproduce it say so here and I'll reopen.

Note: See TracTickets for help on using tickets.