Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ def _init_write_gz(self):
self.__write(b"\037\213\010\010" + timestamp + b"\002\377")
if self.name.endswith(".gz"):
self.name = self.name[:-3]
# Remove directory components
self.name = os.path.basename(self.name)
# RFC1952 says we must use ISO-8859-1 for the FNAME field.
self.__write(self.name.encode("iso-8859-1", "replace") + NUL)

Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ Colm Buckley
Erik de Bueger
Jan-Hein Bührman
Lars Buitinck
Artem Bulgakov
Dick Bulterman
Bill Bumgarner
Jimmy Burgett
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the :mod:`tarfile` module to write only basename of TAR file to GZIP compression header.