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.03:04:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432782297.51.0.951914033096.issue24259@psf.upfronthosting.co.za>
In-reply-to
Content
I guess it depends on the particular tar file and where it gets truncated. Just now I tested with a tar file created from Python’s Tools directory:

$ tar c Tools/ > good.tar
$ ls -gG good.tar 
-rw-r--r-- 1 17397760 May 28 02:43 good.tar
$ head -c 130000 good.tar > cut.tar
$ tar -tf cut.tar
Tools/
[. . .]
Tools/hg/hgtouch.py
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
[Exit 2]

Using Python 2.7.9, I can reproduce Thomas’s behaviour. It extracts the files with no error indication, and actually truncated the last extracted file to 2512 bytes. Adding errorlevel=1 or errorlevel=2 did not make a difference.

Then I tried Python 3.3, 3.4 and 3.6 in various forms. They all seem to raise OSError, even with no errorlevel specified, and create the last file with zero bytes. So in this case I think it is a Python 2 bug (which I’m personally not so motivated to fix).

Ethan: how did you create and truncate your tar file? It almost sounds like it is intact, or maybe didn’t get truncated enough to completely wipe out the EOF block.
History
Date User Action Args
2015-05-28 03:04:57martin.pantersetrecipients: + martin.panter, guettli, lars.gustaebel, ethan.furman, Thomas Güttler
2015-05-28 03:04:57martin.pantersetmessageid: <1432782297.51.0.951914033096.issue24259@psf.upfronthosting.co.za>
2015-05-28 03:04:57martin.panterlinkissue24259 messages
2015-05-28 03:04:57martin.pantercreate