Issue #16601: Restarting iteration over tarfile no more continues from where
it left off. Patch by Michael Birtwell.
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index af59e27..69d342a 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -345,6 +345,14 @@
finally:
os.remove(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.name, m2.name)
+
class StreamReadTest(CommonReadTest):