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.

classification
Title: tarfile.extractall() doesn't extract everything if .next() was used
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Restarting iteration over tarfile continues from where it left off.
View: 16601
Assigned To: serhiy.storchaka Nosy List: Arfrever, jcea, lars.gustaebel, r.david.murray, serhiy.storchaka, techtonik
Priority: normal Keywords: patch

Created on 2012-12-07 04:41 by techtonik, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
16631.patch techtonik, 2012-12-07 04:43
Messages (9)
msg177065 - (view) Author: anatoly techtonik (techtonik) Date: 2012-12-07 04:41
If tarfile.next() is used before .extractall(), the latter fails to extract files that were accessed.
msg177066 - (view) Author: anatoly techtonik (techtonik) Date: 2012-12-07 04:43
Attached is patch with test. Test needs valid extractable .tar file. The testtar.tar that is currently present fails to unpack on Windows because of too long filenames inside.
msg177069 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-07 07:13
Possible this is a duplicate of issue16601.
msg177071 - (view) Author: anatoly techtonik (techtonik) Date: 2012-12-07 07:31
issue16601 is about restarting iterations from zero if interrupted. This one is that extractall() should not use public iteration API at all.
msg177073 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-07 09:04
OK. Then those issues are just related.
msg177086 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-12-07 13:11
I wonder if both bugs are symptoms of an underlying bug: if you call 'iter' twice on a tarfile, are the iterators independent?  Is that even a sensible thing to be able to do?
msg177095 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-07 14:26
Since you iterated to the end any iterators are independent (they are just indices in the list of members).
msg188037 - (view) Author: anatoly techtonik (techtonik) Date: 2013-04-29 05:45
Ping.
msg188766 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-05-09 12:14
Patch for issue16601 has fixed this issue too.
History
Date User Action Args
2022-04-11 14:57:39adminsetgithub: 60835
2013-05-09 12:14:35serhiy.storchakasetstatus: open -> closed
superseder: Restarting iteration over tarfile continues from where it left off.
messages: + msg188766

resolution: duplicate
stage: patch review -> resolved
2013-04-29 07:06:09serhiy.storchakasetassignee: serhiy.storchaka
versions: - Python 3.2
2013-04-29 05:45:35techtoniksetmessages: + msg188037
2012-12-14 08:36:08Arfreversetnosy: + Arfrever
2012-12-10 13:02:03jceasetnosy: + jcea
2012-12-07 14:26:48serhiy.storchakasetmessages: + msg177095
2012-12-07 13:11:02r.david.murraysetnosy: + r.david.murray
messages: + msg177086
2012-12-07 09:04:00serhiy.storchakasetnosy: + lars.gustaebel
messages: + msg177073

type: behavior
stage: patch review
2012-12-07 07:31:48techtoniksetmessages: + msg177071
2012-12-07 07:13:26serhiy.storchakasetnosy: + serhiy.storchaka

messages: + msg177069
versions: - Python 3.1
2012-12-07 04:43:49techtoniksetfiles: + 16631.patch
keywords: + patch
messages: + msg177066
2012-12-07 04:41:16techtonikcreate