PyDocs

Nav

Data Compression and Archiving

BZ2Decompressor.decompress

  • BZ2Decompressor.decompress(data, max_length=-1)
Decompress *data*, returning uncompressed data as bytes.

If *max_length* is nonnegative, returns at most *max_length* bytes
of decompressed data.  If this limit is reached and further output
can be produced, *self.needs_input* will be set to ``False``.  In
this case, the next call to *decompress()* may provide *data* as b''
to obtain more of the output.

If all of the input data was decompressed and returned (either
because this was less than *max_length* bytes, or because
*max_length* was negative), *self.needs_input* will be set to True.

Attempting to decompress data after the end of stream is reached
raises an EOFError.  Any data found after the end of the stream is
ignored and saved in the unused_data attribute.
Changed in 3.5
  • 3.5: Added the max_length parameter.
0 Examples
No examples for bz2/BZ2Decompressor.decompress.
See Also
No see-alsos for bz2/BZ2Decompressor.decompress
0 Notes
No notes for BZ2Decompressor.decompress