[Python-bugs-list] [ python-Bugs-521526 ] Problems when python is renamed

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Feb 2002 01:18:06 -0800


Bugs item #521526, was opened at 2002-02-22 17:11
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=521526&group_id=5470

Category: Distutils
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: R. Lindsay Todd (rltodd)
Assigned to: M.-A. Lemburg (lemburg)
Summary: Problems when python is renamed

Initial Comment:
I use a RedHat 7.2 system where Python 2.2 in an
executable /usr/bin/python2.  This causes some problems
with using distutils.

1) If I say "python2 setup.py bdist_rpm" it creates an
RPM spec file that uses plain "python" instead of
"python2".  Seems to me that this should make use of
the path to the interpreter that is actually running. 
Fortunately this fails, so I can manually hack the spec
file...

2) When including scripts to be interpreted, distutils
looks for the leading #! and the word "python".  My
scripts have the word "python2", since I want to be
able to test them directly.  It seems like distutils
could somehow handle versioned python's, like looking
for a word that begins with "python", or perhaps some
other magic sequence.


----------------------------------------------------------------------

>Comment By: M.-A. Lemburg (lemburg)
Date: 2002-02-28 09:18

Message:
Logged In: YES 
user_id=38388

2) I checked in you first RE. (the shebang is magic enough :-)

----------------------------------------------------------------------

Comment By: R. Lindsay Todd (rltodd)
Date: 2002-02-22 19:09

Message:
Logged In: YES 
user_id=283405

1)  Thanks.  I missed that in the documentation (still do,
after grepping it).  I see it displayed with --help, though.
 Still, I found this behaviour a little surprising (that the
default was not to use the python executable used to invoke
setup.py.

2)  r'^#!.*python[0-9.]*(\s+.*)?$'  would be an improvement,
and handle my case.  Possibly even r'^#!.*python\S*(\s+.*)?$'

Maybe there should instead be a magic comment of some sort
to indicate that this is a python script that should have
line 1 rewritten?

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-02-22 17:38

Message:
Logged In: YES 
user_id=38388

1) use "python setup.py bdist_rpm --python python2";
not a bug.

2) this would require extending the RE in build_scripts.py;
however, I'm not sure what magic you have in mind here ?


----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-02-22 17:37

Message:
Logged In: YES 
user_id=38388

1) use "python setup.py bdist_rpm --python python2";
not a bug.

2) this would require extending the RE in build_scripts.py;
however, I'm not sure what magic you have in mind here ?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=521526&group_id=5470