[mod_python] Where to get latest sources of mod_python?

Martin MOKREJŠ mmokrejs at ribosome.natur.cuni.cz
Mon Jul 4 20:40:22 EDT 2005


Does this help to understand why the problem occurs in my case?

# grep -v '#' /etc/apache2/httpd.conf  | grep Log
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
# grep -v '#' /etc/apache2/modules.d/*  | grep Log
/etc/apache2/modules.d/41_mod_ssl.default-vhost.conf:ErrorLog logs/ssl_error_log
/etc/apache2/modules.d/41_mod_ssl.default-vhost.conf:   TransferLog logs/ssl_access_log
/etc/apache2/modules.d/41_mod_ssl.default-vhost.conf:CustomLog logs/ssl_request_log \
#

Martin

Graham Dumpleton wrote:
> The testhandler problem lies in:
> 
>     req.write('<tr><td><code>%s</code></td><td><code>%s</code> (<a href="?view_log=1" target="_new">view last 100 lines</a>)</td></tr>\n'%(
>         'Apache error log',
>         os.path.join(apache.server_root(),req.server.error_fname)
> 
> The value of req.server.error_fname is possibly None and so it fails.
> 
> The testhandler probably needs to be modified to cope with this.
> 
> Graham
> 
> =?windows-1252?Q?Martin_MOKREJ=8A?= wrote ..
> 
>>
>>Graham Dumpleton wrote:
>>
>>>On 04/07/2005, at 11:01 PM, Martin MOKREJŠ wrote:
>>>
>>>
>>>>Hi,
>>>> I have some weird problem with module imports under mod_python.
>>>>While reloading the webpage on every second reload I get a module  
>>>>import error.
>>>>
>>>> Similarly, I'm getting python executed in "restricted" mode just after
>>>>I use (not import) cElementTree module. Fredrik Lundh mentioned some
>>>>users
>>>>had such problems when expat library was different to the used by  apache
>>>>itself. I got everything recompiled but nothing changed. I use Gentoo
>>>>linux, btw. I have no problems when using elementtree to parse xml 
>>>>files.
>>>
>>>
>>>Restricted mode problems tend to relate to use of Python 2.3.5, Python
>>
>>2.4
>>
>>>or later versions, and a Python code module which is imported making
>>>use of
>>>threads. See:
>>>
>>>   http://sourceforge.net/tracker/index.php? 
>>>func=detail&aid=1163563&group_id=5470&atid=105470
>>>
>>>Ie., it may be this problem in Python itself. If it is, you would need
>>>to use
>>>Python 2.3.4 or earlier version. I don't know if a version of Python
>>
>>which
>>
>>>patches this problem has been released yet or not.
>>
>>
>>I used python 2.3.5 too. The testhandler is giving me this output even
>>for
>>the "restricted" mode testcase. So it might be it's same primary bug as
>>with the index.py problems reported today.
>>
>>General information
>>
>>Mod_python error: "PythonHandler mod_python.testhandler"
>>
>>Traceback (most recent call last):
>>
>> File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299,
>>in HandlerDispatch
>>   result = object(req)
>>
>> File "/usr/lib/python2.4/site-packages/mod_python/testhandler.py", line
>>120, in handler
>>   req.write('
>>
>>\n'%( File "/usr/lib/python2.4/posixpath.py", line 60, in join if b.startswith('/'):
>>AttributeError: 'NoneType' object has no attribute 'startswith'
>>Apache version    Apache
>>Apache threaded MPM    Yes, maximum 25 threads / process
>>Apache forked MPM    Yes, maximum 6 processes
>>Apache server root    /usr/lib/apache2
>>Apache document root    /var/www/localhost/htdocs
>>%s    %s (view last 100 lines 
>>
>>
>>.htaccess contained:
>>
>>AddHandler mod_python .py
>># PythonHandler mod_python.publisher
>># the testhandler gives interresting debug info when something goes wrong
>>PythonHandler mod_python.testhandler
>># make sure processes started under same apache VirtualHost do not have
>>a collision
>>PythonInterpPerDirectory On
>>PythonDebug On


More information about the Mod_python mailing list