[Distutils] python scripts installed with bad first line

Joe VanAndel vanandel@atd.ucar.edu
Tue Dec 11 13:22:00 2001


When using 'distutils' (shipped with Python 2.1) I've found that my
Python scripts installed with a first line of:

#!/usr/bin/python2.1None 

This is caused by distutils trying to patch the first line of the python
script to use the current interpreter.  

Here's a patch to avoid this behavior:
diff -c build_scripts.py.orig build_scripts.py
*** build_scripts.py.orig       Tue Dec 11 10:07:45 2001
--- build_scripts.py    Tue Dec 11 10:19:08 2001
***************
*** 81,86 ****
--- 81,88 ----
                  if match:
                      adjust = 1
                      post_interp = match.group(1)
+                     if not post_interp:
+                         post_interp = ''
 
              if adjust:
                  self.announce("copying and adjusting %s -> %s" %