Feature or enhancement
There is no easy way to get a copy of a zipfile.ZipInfo object with some attributes changed, for example to write a member read from one archive to another under a different name.
I propose to support copy.replace():
zinfo = copy.replace(zf.getinfo('spam.txt'), filename='eggs.txt')
Attributes which are not replaced are inherited from the original object. As in the constructor, the file name is sanitized and the date is validated.
Linked PRs
Feature or enhancement
There is no easy way to get a copy of a
zipfile.ZipInfoobject with some attributes changed, for example to write a member read from one archive to another under a different name.I propose to support
copy.replace():Attributes which are not replaced are inherited from the original object. As in the constructor, the file name is sanitized and the date is validated.
Linked PRs