> Clodoaldo
> Just tested in modwsgi and the above raises Key Error. To satisfy both
> cases (no key and empty value) this works:
>
>    try:
>       length = int(environ.get('CONTENT_LENGTH', 0))
>    except (ValueError):
>       length = 0

If Graham can figure out the size when returning stuff, he probably
can figure out the size of incoming stuff too without breaking the
wsgi standard.
Besides everybody agrees

 s = environ['wsgi.input'].read()

is way better then

    try:
       length = int(environ.get('CONTENT_LENGTH', 0))
    except (ValueError):
       length = 0
    s = environ['wsgi.input'].read(length)

think of how much performance this might loose on a hello world
application :P

--~--~---------~--~----~------------~-------~--~----~
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