Author martin.panter
Recipients martin.panter, mgorny, remi.lapeyre
Date 2018-12-02.12:01:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Yeah, the TarFile class would fix up the header when the user calls “close”. I think this is how it was done for ZipFile (implemented in Issue 26039).

Yes currently you would have to build the tarinfo object by hand. I think a helper function would be nice, but the “TarFile.gettarinfo” method is not a good place for that. In fact, documenting the default settings for the TarInfo constructor may be enough. Then you might get away with the following if you just want a regular file with no specific attributes:

download_tarinfo = TarInfo('index.html')
svgz_tarinfo = TarInfo('image.svg.gz')
Date User Action Args
2018-12-02 12:01:37martin.pantersetrecipients: + martin.panter, mgorny, remi.lapeyre
2018-12-02 12:01:37martin.pantersetmessageid: <>
2018-12-02 12:01:37martin.panterlinkissue35227 messages
2018-12-02 12:01:37martin.pantercreate