[Web-SIG] PEP222 and python on the server?

Mike Orr mso at oz.net
Fri Jun 10 06:46:10 CEST 2005


I may have read the PEP wrong.  I thought it said 'wsgi.input' had to be 
a file object.  But it says it can be a file-like object.  I guess a 
StringIO would suffice, and that would be serializable.

Rene Dudfield wrote:

>Is not possible to use something like sendfile(2) with wsgi?
>
>Where you need a socket file descriptor to use it.
>
>If not, then you can't send files very efficiently.
>
>
>On 6/10/05, Phillip J. Eby <pje at telecommunity.com> wrote:
>  
>
>>At 03:34 PM 6/9/2005 -0700, mso at oz.net wrote:
>>    
>>
>>>The only limitation in WSGI I've found is you can't serialize it for IPC
>>>since it contains an open file descriptor.
>>>      
>>>
>>That's quite a generalization there.  First, many WSGI implementations
>>don't have a file descriptor involved.  Second, there are lots of ways to
>>serialize things, including e.g. transmitting file descriptors via
>>Unix-domain sockets.  Third, nothing stops you from reading the data and
>>sending *that* via your IPC mechanism.  Fourth, you can always do IPC via
>>HTTP.  :)
>>
>>But if what you meant was that pickle, marshal, and XML-RPC won't handle
>>some kinds of file-like objects very well, then, yes, and disregard the
>>previous paragraph.  :)
>>
>>    
>>
>_______________________________________________
>Web-SIG mailing list
>Web-SIG at python.org
>Web SIG: http://www.python.org/sigs/web-sig
>Unsubscribe: http://mail.python.org/mailman/options/web-sig/mso%40oz.net
>  
>



More information about the Web-SIG mailing list