This patch adds support for file(-like) objects and bzip2 compression to tarfile.py. It works around the limitation of the bz2 module that you cannot create a BZ2File object from a file or file-like object but from a filename only. Bug #1488634 reminded me that I had this workaround in my development version of tarfile.py since last year. I think it would generally be a good addition for stdlib's tarfile.py, and would solve the OP's problem as a side-effect. The patch adds a class _BZ2Proxy to Lib/tarfile.py and adds tests for this feature to Lib/test/test_tarfile.py.