creating tar file and streaming it over HTTP?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Jan 13 00:32:03 EST 2010


En Sat, 09 Jan 2010 10:19:00 -0300, pbienst <peter.bienstman at gmail.com>  
escribió:

> OK, thanks to the feedback from everyone I got the PUT from a client
> to the WSGI server working.
>
> I'm now trying to go the other way around: use a tar stream in one of
> the functions in the WSGI server in order to send files to the client.
> Problem is that the WSGI specs expects an iterator as return value for
> streaming, whereas TarFile needs to write to a file obj.
>
> Is there any way I can get these two to work together?

I haven't actually tried it, but aren't you looking for a pipe? (os.pipe()  
+ os.fdopen())

-- 
Gabriel Genellina




More information about the Python-list mailing list