Commit Graph

14 Commits

Author SHA1 Message Date
Nadeem Vawda af518c198e Add a function bz2.open(), to match gzip.open(). 2012-06-04 23:32:38 +02:00
Nadeem Vawda 50cb936bd0 Clarify acceptable values for BZ2File.__init__'s mode argument. 2012-06-04 23:31:22 +02:00
Nadeem Vawda aebcdba829 Make BZ2File's fileobj support easier to use.
The fileobj argument was added during the 3.3 development cycle, so this change
does not break backward compatibility with 3.2.
2012-06-04 23:31:20 +02:00
Nadeem Vawda ae557d767f Fix seekable() in BZ2File and LZMAFile to check whether the underlying file supports seek(). 2012-02-12 01:51:38 +02:00
Nadeem Vawda 54d8144bb0 Make BZ2File.__init__()'s fileobj argument keyword-only. 2012-02-04 13:58:07 +02:00
Nadeem Vawda cac8909d0c Update docstring for BZ2File.__init__(). 2012-02-04 13:08:11 +02:00
Nadeem Vawda 72750a85f9 Issue #13809: Make bz2 module work with threads disabled.
Original patch by Amaury Forgeot d'Arc.
2012-01-18 01:57:14 +02:00
Nadeem Vawda 44ae4a2a22 Make error handling in BZ2File.{readable,seekable,writable,fileno} consistent with TextIOWrapper.
Also, add tests for these methods.
2011-11-30 17:39:30 +02:00
Nadeem Vawda 249ab5e8d1 BZ2File now uses the compresslevel argument given by the caller,
instead of ignoring it and always using a compression level of 9.
2011-09-11 22:38:11 +02:00
Nadeem Vawda 98838bac9c Miscellaneous cleanups to bz2 and test_bz2 following issue #1625.
* In bz2.decompress(), concatenate partial results in a way that should
   be more friendly to other Python implementations
* Remove redundant comments in test_bz2
* Use 'while True:' instead of 'while 1:'
2011-05-30 01:12:24 +02:00
Nadeem Vawda 55b4338874 Issue #1625: BZ2File and bz2.decompress() now support multi-stream files.
Initial patch by Nir Aides.
2011-05-27 01:52:15 +02:00
Nadeem Vawda f1a1af21eb Fix typo in bz2 module. 2011-05-25 00:32:08 +02:00
Antoine Pitrou 24ce386387 Fix whitespace 2011-04-03 17:08:49 +02:00
Antoine Pitrou 37dc5f85b8 Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept
file-like objects using a new `fileobj` constructor argument.  Patch by
Nadeem Vawda.
2011-04-03 17:05:46 +02:00