[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: After some consideration, I think this is probably more correct: ``` --- /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py 2016-12-17 12:41:21.0 -0800 +++ tarfile.py 2017-03-10 14:57:15.0 -0800 @@ -2347,9 +2347,10 @@

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Changes by Matt Bogosian : Removed file: http://bugs.python.org/file46717/tarfile.patch ___ Python tracker ___

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: This patch (also attached) seems to address this particular use case: ``` --- a/Lib/tarfile.py2016-12-17 12:41:21.0 -0800 +++ b/Lib/tarfile.py2017-03-10 12:23:34.0 -0800 @@ -2347,7 +2347,7 @@ # Advance the file pointer.

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: I'm not sure if it helps at this point, but I've tried several "flavors" of apparently legit tar files with zero entries. All fail. ``tarfile`` module: ``` $ ( set -x ; cd /tmp || exit 1 ; python -V ; rm -fv test.tar ; python -c 'import os, tarfile ; fd =

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +lars.gustaebel type: crash -> behavior versions: -Python 3.3, Python 3.4 ___ Python tracker

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Matt Bogosian
Matt Bogosian added the comment: FWIW, the (offending) fix for #24259 was introduced (e.g., in 2.7) via 2.7.10. I've verified that 2.7.9 works as expected: ``` $ python -V Python 2.7.9 $ python tarfail.py opening /…/tarfail/test.tar.bz2 opening /…/tarfail/test.tar .

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Matt Bogosian
New submission from Matt Bogosian: It looks like there's a problem examining ``.tar`` files with no entries: ``` $ # == $ # Extract test cases (attached to this bug report) $ tar xpvf tarfail.tar.bz2 x tarfail/ x tarfail/tarfail.py