durusmail: quixote-users: Quixote on MacOS X 10.1.5?
Quixote on MacOS X 10.1.5?
2002-08-14
2002-08-14
2002-08-14
2002-08-14
2002-08-14
2002-08-17
Quixote on MacOS X 10.1.5?
paul_chakravarti
2002-08-14
I had a similar problem running under MacOSX 10.1.5 & tracked the
problem down to the FCGI test in the _startup function
(fcgi.py:373) - this checks whether stdin is actually a socket by
attempting to call getpeername() on the fd however for some reason
the call appears to behave strangely on OSX when running via CGI.

Running the following test stub (extracted from fcgi.py) from the
command line or via CGI gives the following (different) results on
OSX and OpenBSD:

----- test_getpeername.cgi
#!/usr/local/bin/python2.2
import sys,socket
try:
     s = socket.fromfd(sys.stdin.fileno(),
                       socket.AF_INET,
                       socket.SOCK_STREAM)
     s.getpeername()
except socket.error, (err,errmsg):
     print "Content-Type: text/plain\n"
     print err,":",errmsg
-----

OSX - Command Line:
        38 : Socket operation on non-socket
OSX - CGI
        57 : Socket is not connected
OpenBSD - CommandLine
        38 : Socket operation on non-socket
OpenBSD - CGI
        38 : Socket operation on non-socket

I didn't take much time to analyse this and just explicitly
disabled FCGI - the patch to fcgi.py is attached. Other than this
everything seems to work fine on OSX (havent tried SCGI yey
however).

PaulC


*** fcgi.py.orig        Wed Aug 14 21:03:03 2002
--- fcgi.py     Wed Aug 14 21:03:21 2002
***************
*** 376,381 ****
--- 376,387 ----
       if sys.platform[:3] == 'win':
           _isFCGI = 0
           return
+     # MacOSX returns ENOTCONN under CGI which prevents
+     # the FCGI socket test working correctly so we
+     # explicitly disable FCGI here
+     if sys.platform == 'darwin':
+         _isFCGI = 0
+         return

       _init = 1
       try:


On Wednesday, August 14, 2002, at 02:07 PM, t e whalen wrote:

> I don't recall seeing reports from anyone using Quixote on Mac OS X, so
> you're probably the first one trying it.
>
> The following mix successfully runs the Quixote demo on my machine:
>
> Mac OS X 10.1.5
> Apache 1.3.26 (Darwin)
> Python 2.2
> Quixote 0.5 (CVS)
>
> There /are/ some problems with the part of the quixote code that
> identifies what
> kind of CGI is involved in the call.  I ended up having to import
> and enable cgitb
> in demo.cgi to see where the problem was.
>
> In fcgi.py, line 243 was raising a (22, 'Invalid Argument'), when
> using Quixote
> under regular CGI.  I didn't bother figuring out why, I just
> commented that part of
> the code out, or made sure _isFCGI was always false or something.
> Given some
> encouragement, I could try to figure out why it wasn't working.  I
> eventually just
> switched to mod_fastcgi and stopped worrying about it, returning
> the code to
> its pristine state.
>
> tew
>
> ---
> "Everything" does not include ketchup
> t e whalen - tew@introvert.net - http://introvert.net/
>
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://www.mems-exchange.org/mailman/listinfo/quixote-users
>



reply