summaryrefslogtreecommitdiff
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorJan Wolski <jan@wolski.fi>2022-05-15 17:49:19 +0300
committerGitHub <noreply@github.com>2022-05-15 23:49:19 +0900
commit26a162baef96d78656e189b2fa16fdcab7195730 (patch)
treee353c2a366ac607a8af8f53c79a631713e323eef /Lib/zipfile.py
parent90e72300730189c4a48529baaad9b0005d40731c (diff)
downloadcpython-git-26a162baef96d78656e189b2fa16fdcab7195730.tar.gz
gh-89668: Optimize ZipFile file header processing algorithm to avoid unneeded IO(gh-25966)
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index dc02011084..9f4437526c 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1564,7 +1564,7 @@ class ZipFile:
fname = zef_file.read(fheader[_FH_FILENAME_LENGTH])
if fheader[_FH_EXTRA_FIELD_LENGTH]:
- zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH])
+ zef_file.seek(fheader[_FH_EXTRA_FIELD_LENGTH], whence=1)
if zinfo.flag_bits & _MASK_COMPRESSED_PATCH:
# Zip 2.7: compressed patched data