diff --git a/Lib/tarfile.py b/Lib/tarfile.py index a0fab46b24e249..75de0e3a1d063a 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -480,25 +480,27 @@ def _init_read_gz(self): # taken from gzip.GzipFile with some alterations if self.__read(2) != b"\037\213": raise ReadError("not a gzip file") - if self.__read(1) != b"\010": + (method, flag, _) = struct.unpack("