gzip.GzipFile

class gzip.GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)[source]

The GzipFile class simulates most of the methods of a file object with the exception of the readinto() and truncate() methods.

Methods

__enter__
__exit__
__format__ default object formatter
__init__([filename, mode, compresslevel, ...]) Constructor for the GzipFile class.
__new__((S, ...)
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__repr__()
__sizeof__(() -> int) size of object in memory, in bytes
__subclasshook__ Abstract classes can override this to customize issubclass().
_add_read_data(data)
_checkClosed
_checkReadable
_checkSeekable
_checkWritable
_check_closed() Raises a ValueError if the underlying file object has been closed.
_init_read()
_init_write(filename)
_read([size])
_read_eof()
_read_gzip_header()
_unread(buf)
_write_gzip_header()
close()
detach Disconnect this buffer from its underlying raw stream and return it.
fileno() Invoke the underlying file object’s fileno() method.
flush([zlib_mode])
isatty Return whether this is an ‘interactive’ stream.
read([size])
read1 Read and return up to n bytes, with at most one read() call to the underlying raw stream.
readable()
readinto
readline([size])
readlines Return a list of lines from the stream.
rewind() Return the uncompressed stream file position indicator to the
seek(offset[, whence])
seekable()
tell Return current stream position.
truncate Truncate file to size bytes.
writable()
write(data)
writelines