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.

Title: Restarting iteration over tarfile continues from where it left off.
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, asvetlov, jcea, lars.gustaebel, mbirtwell, python-dev, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2012-12-03 20:01 by mbirtwell, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
fix-tarfile-restart-iteration.patch mbirtwell, 2012-12-03 20:01 Patch review
fix-tarfile-restart-iteration2.patch mbirtwell, 2012-12-03 20:19 review
test-tarfile-restart-iteration.patch mbirtwell, 2012-12-03 23:00 review
Messages (10)
msg176863 - (view) Author: Michael Birtwell (mbirtwell) * Date: 2012-12-03 20:01
If you partially iterate over a tarfile then try and restart iteration of that tarfile it will continue from where it left off rather than restarting from the beginning.

I've only tried this with the tarfile implementation in python 2.7 but the 3.x code looks the same in this respect.

I've included a patch with my approach to fixing this.
msg176865 - (view) Author: Michael Birtwell (mbirtwell) * Date: 2012-12-03 20:19
Embarrassingly as soon as I uploaded that patch I found a problem with it. I hadn't taken in to account the special case for the first member.

Here's a replacement patch
msg176866 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-12-03 20:56
Thanks for the patch.

Could you either include a test or post code that demonstrates the problem, please?
msg176868 - (view) Author: Michael Birtwell (mbirtwell) * Date: 2012-12-03 23:00
Here's a patch on the tarfile's unittest module.
msg177074 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-07 09:07
Related issue: issue16631.
msg179831 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-01-12 21:16
Michael Birtwell, can you please submit a contributor form?
msg181141 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-02 07:38
Michael, what's the status of your contributor form?
msg188763 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-09 11:39
New changeset 9b86fb6f5bc9 by Serhiy Storchaka in branch '2.7':
Issue #16601: Restarting iteration over tarfile no more continues from where

New changeset 9ed127d8ad61 by Serhiy Storchaka in branch '3.3':
Issue #16601: Restarting iteration over tarfile no more continues from where

New changeset 1c6a1427353b by Serhiy Storchaka in branch 'default':
Issue #16601: Restarting iteration over tarfile no more continues from where
msg188764 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-05-09 12:01
Thank you for contribution.

I have committed simpler test.
msg188765 - (view) Author: Michael Birtwell (mbirtwell) * Date: 2013-05-09 12:13
Sorry about the delay in the contributor form. Things got in the way then I completely forgot about it. It's done now.
Date User Action Args
2022-04-11 14:57:39adminsetgithub: 60805
2013-05-09 12:14:35serhiy.storchakalinkissue16631 superseder
2013-05-09 12:13:09mbirtwellsetmessages: + msg188765
2013-05-09 12:01:14serhiy.storchakasetstatus: open -> closed
versions: - Python 3.2
messages: + msg188764

resolution: fixed
stage: patch review -> resolved
2013-05-09 11:39:31python-devsetnosy: + python-dev
messages: + msg188763
2013-02-02 07:38:40serhiy.storchakasetmessages: + msg181141
2013-01-12 21:16:48serhiy.storchakasetmessages: + msg179831
2012-12-29 21:57:46serhiy.storchakasetassignee: serhiy.storchaka
2012-12-15 18:01:55asvetlovsetnosy: + asvetlov
2012-12-14 08:35:58Arfreversetnosy: + Arfrever
2012-12-07 09:08:49serhiy.storchakasetstage: patch review
2012-12-07 09:08:32serhiy.storchakasetnosy: + lars.gustaebel

versions: + Python 3.2, Python 3.3, Python 3.4
2012-12-07 09:07:45serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg177074
2012-12-05 20:38:26jceasetnosy: + jcea
2012-12-03 23:00:41mbirtwellsetfiles: + test-tarfile-restart-iteration.patch

messages: + msg176868
2012-12-03 20:56:31r.david.murraysetnosy: + r.david.murray
messages: + msg176866
2012-12-03 20:19:33mbirtwellsetfiles: + fix-tarfile-restart-iteration2.patch
type: behavior
messages: + msg176865
2012-12-03 20:01:12mbirtwellcreate