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 b224bf0..9b98df2 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -415,6 +415,14 @@
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):