This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Thomas Güttler, ethan.furman, guettli, lars.gustaebel, martin.panter
Date 2015-05-28.01:08:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432775299.28.0.0122708517032.issue24259@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2015-05-28 01:08:19martin.pantersetrecipients: + martin.panter, guettli, lars.gustaebel, ethan.furman, Thomas Güttler
2015-05-28 01:08:19martin.pantersetmessageid: <1432775299.28.0.0122708517032.issue24259@psf.upfronthosting.co.za>
2015-05-28 01:08:19martin.panterlinkissue24259 messages
2015-05-28 01:08:19martin.pantercreate