[mod_python] httplib: [notice] child pid 8937 exit signal Segmentation fault (11)

IlpoNyyssönen iny at iki.fi
Tue Jul 4 16:58:02 EST 2000


I tried to use urllib to retrieve some pictures dynamically, but the
child dies with segmentation fault. This happens also with httplib,
for example with the code below. The dying seems to happen when
closing the connection.

-- clip --
from mod_python import apache
import httplib

def handler(req):
    req.content_type = 'text/plain'
    req.send_http_header()
    
    h = httplib.HTTP('www.python.org')
    h.putrequest('GET', '/index.html')
    h.putheader('Accept', 'text/html')
    h.putheader('Accept', 'text/plain')
    h.endheaders()
    errcode, errmsg, headers = h.getreply()
    if errcode == 200:
        f = h.getfile()
        req.write(f.read())

    return apache.OK
-- clip --

-- 
Ilpo Nyyssönen # biny
/* :-) */



More information about the Mod_python mailing list