[issue24259] tar.extractall() does not recognize unexpected EOF

Lars Gustäbel report at bugs.python.org
Mon Jun 1 08:49:39 CEST 2015


Lars Gustäbel added the comment:

@Martin:

This is actually a nice idea that I hadn't thought of. I updated the Python 3 patch to use a seek() that moves to one byte before the next header block, reads the remaining byte and raises an error if it hits eof. The code looks rather clean compared to the previous patch, and it should perform like it always did.

I am not quite sure about which exception type to use, ReadError is used in tarfile's header parsing code, but OSError is already used in tarfile.copyfileobj() and might be more like what the user expects.

----------
Added file: http://bugs.python.org/file39579/issue24259-3.x-2.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24259>
_______________________________________


More information about the Python-bugs-list mailing list