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 gregory.p.smith
Recipients gregory.p.smith
Date 2014-12-15.19:27:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418671674.41.0.864207249713.issue23056@psf.upfronthosting.co.za>
In-reply-to
Content
$ cat >test.py <<EOF
import tarfile
import sys

with tarfile.open(sys.argv[1], mode="r|*") as f:
  while True:
    info = f.next()
    if not info:
      break
EOF
$ tar cf test.tar -T /dev/null
$ python2.7 test.py test.tar
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    info = f.next()
  File "/usr/lib/python2.7/tarfile.py", line 2319, in next
    self.fileobj.seek(self.offset)
  File "/usr/lib/python2.7/tarfile.py", line 555, in seek
    raise StreamError("seeking backwards is not allowed")
tarfile.StreamError: seeking backwards is not allowed
$ python3.4 test.py test.tar
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    info = f.next()
  File "/usr/lib/python3.4/tarfile.py", line 2244, in next
    self.fileobj.seek(self.offset)
  File "/usr/lib/python3.4/tarfile.py", line 518, in seek
    raise StreamError("seeking backwards is not allowed")
tarfile.StreamError: seeking backwards is not allowed

I have reconfirmed that the above still happens using a top of tree 2.7.9+ build.
History
Date User Action Args
2014-12-15 19:27:54gregory.p.smithsetrecipients: + gregory.p.smith
2014-12-15 19:27:54gregory.p.smithsetmessageid: <1418671674.41.0.864207249713.issue23056@psf.upfronthosting.co.za>
2014-12-15 19:27:54gregory.p.smithlinkissue23056 messages
2014-12-15 19:27:54gregory.p.smithcreate