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.

Author rossmclendon
Recipients rossmclendon
Date 2009-09-02.04:42:06
SpamBayes Score 2.2494784e-11
Marked as misclassified No
Message-id <1251866532.69.0.504306670253.issue6818@psf.upfronthosting.co.za>
In-reply-to
Content
It would be most helpful if a method could be included in the TarFile
class of the tarfile module and the ZipFile class of the zipfile module
that would remove a particular file (either given by a name or a
TarInfo/ZipInfo object) from the archive.

Usage to remove a single file from an archive would be as follows:

import zipfile
zipFileObject = zipfile.ZipFile(archiveName,'a')
zipFileObject.remove(fileToRemove)
zipFileObject.close()

Such a method should probably only apply to archives that are in append
mode as write mode would erase the original archive and read mode should
render the archive immutable.

One possible extra to be included is to allow a list of file names or
ZipInfo/TarInfo objects to be passed into the remove method, such that
all items in the list would be removed from the archive.
History
Date User Action Args
2009-09-02 04:42:14rossmclendonsetrecipients: + rossmclendon
2009-09-02 04:42:12rossmclendonsetmessageid: <1251866532.69.0.504306670253.issue6818@psf.upfronthosting.co.za>
2009-09-02 04:42:09rossmclendonlinkissue6818 messages
2009-09-02 04:42:07rossmclendoncreate