Martin Panter added the comment: Actually, looking closer at the module, perhaps you just need to set the errorlevel=1 option:
>>> with tarfile.open("truncated.tar", errorlevel=1) as tar:... >>> tar.extractall("test-dir") ... Traceback (most recent call last): File "<stdin>", line 2, in <module> File "/home/proj/python/cpython/Lib/tarfile.py", line 1996, in extractall numeric_owner=numeric_owner) File "/home/proj/python/cpython/Lib/tarfile.py", line 2038, in extract numeric_owner=numeric_owner) File "/home/proj/python/cpython/Lib/tarfile.py", line 2108, in _extract_member self.makefile(tarinfo, targetpath) File "/home/proj/python/cpython/Lib/tarfile.py", line 2154, in makefile copyfileobj(source, target, tarinfo.size) File "/home/proj/python/cpython/Lib/tarfile.py", line 242, in copyfileobj raise OSError("end of file reached") OSError: end of file reached ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24259> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com