Victor Muslin victor at prodigy.net
Wed Dec 27 19:32:19 EST 2000

Sorry for newbie questions, but I ran into a couple of problems with
fcgi.py. I am using Python 1.5.2 on WindowsNT 4.0.

1) I tried to run fcgi.py from the command line (to exercise its
_test() function) and received the following error message:

	D:/Apps/apache/cgi-bin> fcgi.py
	Exception exceptions.AttributeError: 'err' in <method
FCGI.__del__ of FCGI instance at 82a220> ignored

The traceback was:

	Traceback (innermost last):
	  File "fcgi.py", line 386, in _test
	    req = Accept()
	  File "fcgi.py", line 231, in __init__
	  File "fcgi.py", line 367, in _startup
	    s=socket.fromfd(sys.stdin.fileno(), socket.AF_INET,
	AttributeError: fromfd

Seems that the socket module for WindowsNT Python 1.5.2 does not have
fromfd() method.

Here's the proof (at least for my Python installation):

>>> pprint.pprint(dir(socket))

socket.fromfd() method is called in the fcgi._startup() function,
which is called in the constructor of FCGI object. Since
fcgi._startup() function is catching only socket.error exceptions
instead of AttributeError exception the program dumps.

If AttributeError except clause is added immediately after the
socket.error() in fcgi._startup():

    except AttributeError:
            global _isFCGI
            _isFCGI = 0

then the program works fine.

Is there something I am doing wrong or is there something wrong with
my Python installation?

2) I was wondering whether it is possible to use fcgi.py based
programs with Apache using cgi-fcgi brdige. If so, how would one
configure cgi-fcgi to know to launch a python interpreter with a
specific program to interpret? If there is an example it would be
greatly appreciated.


More information about the Python-list mailing list