mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Issue #16601: Restarting iteration over tarfile no more continues from where
it left off. Patch by Michael Birtwell.
This commit is contained in:
parent
6bcc0f1b51
commit
263fab94ee
4 changed files with 19 additions and 5 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue