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 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 <1543752097.79.0.788709270274.issue35227@psf.upfronthosting.co.za>
In-reply-to
Content
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')
History
Date User Action Args
2018-12-02 12:01:37martin.pantersetrecipients: + martin.panter, mgorny, remi.lapeyre
2018-12-02 12:01:37martin.pantersetmessageid: <1543752097.79.0.788709270274.issue35227@psf.upfronthosting.co.za>
2018-12-02 12:01:37martin.panterlinkissue35227 messages
2018-12-02 12:01:37martin.pantercreate