PyApache and MySQLdb (was Re: anyone get one of the python apache modules to work with 2.1?)

Brandon Long blong at fiction.net
Tue Aug 28 17:46:49 EDT 2001


[Lele at seldati.it]
>   BL> I've tried PyApache 4.25, mod_python 2.7.6 and mod_snake 0.5.0
>   BL> (and the latest mod_snake from CVS yesterday), and none of
>   BL> them seem to work.  
>   BL> PyApache will work in SingleIntepreter mode, but without that
>   BL> on, it only works the first time through the CGI per apache
>   BL> child process.  Ever follow on will fail to import some random
>   BL> module.
> 
> I hope I'll be testing PyApache with Python 2.1 during the weekend, or
> the next week. What is exactly the error message?

Ok, it seems somehow related to the MySQLdb module (0.9.0)

On the second request, the import of the site.py module fails (during
import __builtin__) with:
'import site' failed; traceback:
Traceback (most recent call last):
  File "/neo/opt/encap/python-2.1-nothread/lib/python2.1/site.py", line 60, in ?    
     import sys, os
  File "/neo/opt/encap/python-2.1-nothread/lib/python2.1/os.py", line 54, in ?
    __all__.extend(_get_exports_list(posix))
  File "/neo/opt/encap/python-2.1-nothread/lib/python2.1/os.py", line 35, in _get_exports_list
    return list(module.__all__)
AttributeError: 'posix' module has no attribute '__all__'


I have the following dirt simple CGI
-----------------------
#!/neo/opt/encap/python-2.1-nothread/bin/python

import sys
sys.stderr.write('%s\n' % (repr(sys.path)))
import time
import MySQLdb

print "Content-Type: text/html\n\n"
print "This is a test"
print "%s" % repr(sys.path)
-----------------------

The import MySQLdb seems to be the culprit, not importing that and the
import of site works fine.

Brandon
-- 
 "We [the Net] get portrayed in a crappy light...  This time it's a cult.  
  Usually, it's that we're all child pornographers."  
                    -- Internet Defender, _Washington Post_, 3-29-97
                                           http://www.fiction.net/blong/




More information about the Python-list mailing list