New submission from Maciej Misiak <maciej.mm.mis...@gmail.com>:
This code is incomplete: def _init_write_gz(self): ... if self.name.endswith(".gz"): self.name = self.name[:-3] # RFC1952 says we must use ISO-8859-1 for the FNAME field. self.__write(self.name.encode("iso-8859-1", "replace") + NUL) If it is used in following way '.gz' is stripped properly and FNAME='somefile.tar': tarfile.open('somefile.tar.gz', 'w:gz') but with tarfile.open('somefile.tgz', 'w:gz') FNAME is incorrectly prepared as somefile.tgz ---------- components: Library (Lib) messages: 396382 nosy: maciej.mm.misiak priority: normal severity: normal status: open title: wrong FNAME in tarfile if tgz extension is used versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44495> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com