commit | 371432b961b7f5b410c13b0022e23111115f1d59 | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Mon Apr 08 22:33:55 2013 +0300 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Mon Apr 08 22:33:55 2013 +0300 |
tree | aba081850b1cfbb4bde8f98756118f4818fae05f | |
parent | 6cb4343d0d374a1b0ba01390ccef5b8868a5e9fc [diff] [blame] |
Close #17666: Fix reading gzip files with an extra field.
diff --git a/Lib/gzip.py b/Lib/gzip.py index a2f2367..99b2d3e 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py
@@ -202,7 +202,8 @@ if flag & FEXTRA: # Read & discard the extra field, if present - self._read_exact(struct.unpack("<H", self._read_exact(2))) + extra_len, = struct.unpack("<H", self._read_exact(2)) + self._read_exact(extra_len) if flag & FNAME: # Read and discard a null-terminated string containing the filename while True: