Issue 40175: Add support for removing zip entry in ZipInfo (original) (raw)

Created on 2020-04-03 15:38 by yudilevi, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19336 closed yudilevi,2020-04-03 15:43
Messages (6)
msg365704 - (view) Author: Yudi Levi (yudilevi) * Date: 2020-04-03 15:38
ZipInfo currently only allow adding entries to zip archives but doesn't have the ability to remove entries from them - pretty useful feature.
msg365734 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2020-04-04 00:56
> ZipInfo currently only allow adding entries to zip archives but doesn't have the ability to remove entries from them - pretty useful feature. This public API enhancement seems substantial enough to warrant a python-ideas ML thread or topic in the "Ideas" category of discuss.python.org. It would help to demonstrate some real-world examples where one may want to programmatically remove entries. Also, added zipfile maintainers to the nosy list.
msg365750 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-04 08:38
This is a duplicate of and .
msg365752 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2020-04-04 09:02
Serhiy Storchaka wrote: > This is a duplicate of and . It probably would have been better to mention it in , but IMO, those issues have been inactive long enough that it's reasonable to re-address the issue. zipfile is not an area of expertise for me though, so I can't say if anything substantial has changed for the arguments against it in to no longer apply. That's partly why I suggested python-ideas or discuss.python.org.
msg365753 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-04 10:14
There were other issues and discussions about this. The problem of removing a file from a ZIP archive is similar to the problem of removing a line from a file. It cannot be made efficiently, and it is not even always possible. In some cases it may be better (simpler, more efficient and robust) to copy a file line by line into a new file, skipping particular lines, and the same is true for a ZIP archive. In other cases you can truncate the file or the ZIP archive. Solution that is optimal in one case may be inappropriate in other case.
msg365754 - (view) Author: Yudi Levi (yudilevi) * Date: 2020-04-04 10:20
Sorry, I didn't see the old issue, let's move the discussion over there - https://bugs.python.org/issue6818
History
Date User Action Args
2022-04-11 14:59:29 admin set github: 84356
2020-04-04 10:20:54 yudilevi set status: open -> closedresolution: duplicatemessages: + stage: patch review -> resolved
2020-04-04 10:14:35 serhiy.storchaka set messages: +
2020-04-04 09:02:27 aeros set messages: +
2020-04-04 08:38:02 serhiy.storchaka set messages: +
2020-04-04 00:56:42 aeros set nosy: + alanmcintyre, serhiy.storchaka, twouters, aerosmessages: +
2020-04-03 15:43:22 yudilevi set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest18699>
2020-04-03 15:38:22 yudilevi create