Issue #16601: Restarting iteration over tarfile no more continues from where

it left off.  Patch by Michael Birtwell.
This commit is contained in:
Serhiy Storchaka 2013-05-09 14:22:26 +03:00
parent 6bcc0f1b51
commit 263fab94ee
4 changed files with 19 additions and 5 deletions

View file

@ -415,6 +415,14 @@ class MiscReadTest(CommonReadTest):
finally:
support.unlink(empty)
def test_parallel_iteration(self):
# Issue #16601: Restarting iteration over tarfile continued
# from where it left off.
with tarfile.open(self.tarname) as tar:
for m1, m2 in zip(tar, tar):
self.assertEqual(m1.offset, m2.offset)
self.assertEqual(m1.get_info(), m2.get_info())
class StreamReadTest(CommonReadTest):