mod_python make install problem

Stefan Schwarzer s.schwarzer at ndh.net
Sat Jan 19 13:20:12 CET 2002


Hello Lewis

My background isn't so much in mod_python; my text is more general.

Lewis Bergman wrote:
> Would anyone here maybe have seen this and know how to fix it?
> ------ original message ----------------
> 
> Background:
> Python 2.2 , configured --with-threads=no
> mod_python 2.7.6
> Apache 1.3.22-2 , (rpm)
> Apache-devel 1.3.22-2 , (rpm) for apxs
> 
> My configure line looks like this:
> ./configure --with-apxs=/usr/sbin/apxs --with-python=/root/tar/Python-2.2
> no errors here.
> I do a make and get no errors.
> 
> On make install I get this:
> python /usr/local/lib/python2.2/compileall.py
> /usr/local/lib/python2.2/site-packages/mod_python
> Traceback (innermost last):
>   File "/usr/local/lib/python2.2/compileall.py", line 147, in ?
>     exit_status = not main()
>   File "/usr/local/lib/python2.2/compileall.py", line 104, in main
>     import getopt
>   File "/usr/local/lib/python2.2/getopt.py", line 101
>     possibilities = [o for o in longopts if o.startswith(opt)]
>                                    ^
> SyntaxError: invalid syntax

The SyntaxError is raised on the _import_ of getopt. Looking at the
source of getopt it's obvious that the code of long_has_args (which
contains "possibilities = [o for o in longopts if o.startswith(opt)]"
as its first line, is _not_ executed. It's only parsed.

So if the code raises a SyntaxError during parsing I could imagine
that someone altered the source to try something out and introduced
tab characters.

Another reason could be that the getopt code from the Python 2.2
library is actually executed by an older Python interpreter that
doesn't know of list comprehensions.

Hope that helps.

Stefan



More information about the Python-list mailing list