On Jan 25, 2:59 am, Graham Dumpleton <[email protected]>
wrote:
> 2009/1/25 gert <[email protected]>:
>
> > What does this mean ?
>
> > [Sun Jan 25 01:10:02 2009] [error] [client 217.136.57.14] Traceback
> > (most recent call last):
> > [Sun Jan 25 01:10:02 2009] [error] [client 217.136.57.14]   File "/
> > home/www/appwsgi/www/lib/upload.py", line 12, in application
> > [Sun Jan 25 01:10:02 2009] [error] [client 217.136.57.14]     s =
> > environ['wsgi.input'].read().decode('latin1')
> > [Sun Jan 25 01:10:02 2009] [error] [client 217.136.57.14] SystemError:
> > Objects/bytesobject.c:3171: bad argument to internal function
>
> It means something bad happened. What is the exact line and
> surrounding lines of Python code in WSGI application doing?
>
> Include the existing contents of the email in the reply so context not
> lost. Do not reply with only the new stuff you want to add as it makes
> it very hard to track the conversation.

def application(environ, response):
    db = Db()
    cookie = "SID="+environ['QUERY_STRING']
    session = Session(db,cookie,'guest')
    response('200 OK', [('Content-type', 'text/xml'), ('Set-Cookie',
session.COOKIE)])
    if not session.GID : return []
    s = environ['wsgi.input'].read().decode('latin1')
    p = search(r'Content-Type: application/octet-stream\r\n\r\n(.*?)\r
\n--',s,DOTALL).group(1)
    db.execute('UPDATE users SET picture=? WHERE uid=?',(p.encode
('latin1'),session.UID))
    xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    xml+= "<root>"+str(db.ERROR)+"</root>"
    response('200 OK', [('Content-type', 'text/xml')])
    return [xml]

i get this error on files with a size of 182 KB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to