Martin Panter <vadmium...@gmail.com> added the comment: 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') ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35227> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com