> 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.
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.
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.