[mod_python] mysqldb calls cause segfault

Erdi Balint erdibalint at freemail.hu
Mon Oct 10 17:10:11 EDT 2005


I've finally removed the mod_python debian package and compiled it from 
source, it somehow did the trick, finding the right python interpreter!

Thank you once more for your help,
Balint

Erdi Balint wrote:
> Hi Nicolas,
> 
> Thanks for your help, I've added one line to your script to see if the
> interpreter uses 2 or 4-byte wide unicode strings (the root of the 
> problem).
> 
> the script:
> 
> import sys
> def handler(req):
>     req.content_type = 'text/plain'
>     req.write(sys.version+'\n')
>     req.write(sys.exec_prefix+'\n')
>     req.write(`sys.maxunicode`+'\n')
>     return apache.OK
> 
> 
> the output:
> 
> 2.3.4 (#1, Dec 30 2004, 12:39:04)
> [GCC 3.3.5 (Debian 1:3.3.5-5)]
> /usr
> 65535
> 
> So there it is, black & white, it uses 2-byte wide Unicode chars, that
> causes the trouble, but how do I track down which python interpreter is
> called? To my knowledge, python >=2.3 uses 4-byte wide unicode, so how
> do I track down which python interpreter is used? (or maybe more simple
> question is how do I force the mod_python/mysqldb extension to use the
> "good" python interpreter)?
> 
> Balint
> 
> Nicolas Lehuen wrote:
> 
>> Are you sure mod_python is using the same Python interpreter as the 
>> one you made the test in ?
>>
>> Try running this handler :
>>
>> from mod_python import apache
>> import sys
>> def handler(req):
>>     req.content_type = 'text/plain'
>>     req.write(sys.version+'\n')
>>     req.write(sys.exec_prefix+'\n')
>>     return apache.OK
>>
>> Regards,
>> Nicolas
>>


More information about the Mod_python mailing list