Gzip -> FTP w/o using a temporary file

Andrew M. Kuchling akuchlin at mems-exchange.org
Mon Apr 24 17:15:44 EDT 2000


"Joel Burton" <pup at pobox.com> writes:
> I tried using os.pipe() to create an r/w pipe, but the 'w' part of the pipe
> isn't writable, according to gzip.GzipFile()

os.pipe() returns file descriptors, which are small integers, while
GzipFile expects a Python file object.  Wrap the file descriptor in
a file object using os.fdopen(), something like
output = os.fdopen( w, 'wb')

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
Sending a newgroup message without permission of Leader Kibo: Poster is forced
to adopt twelve wacky sitcom children.
  -- Kibo, in the Happynet Manifesto



More information about the Python-list mailing list