summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipfile.py
diff options
context:
space:
mode:
authorJuniorJPDJ <github.com@juniorjpdj.pl>2022-08-06 23:21:23 (GMT)
committerGitHub <noreply@github.com>2022-08-06 23:21:23 (GMT)
commit330f1d58282517bdf1f19577ab9317fa9810bf95 (patch)
treec3e6ed80f849028056fbf64a9bb5cad8ad0d974d /Lib/test/test_zipfile.py
parent56af5a200d60e86a8ac450264729d693053275e3 (diff)
downloadcpython-330f1d58282517bdf1f19577ab9317fa9810bf95.zip
cpython-330f1d58282517bdf1f19577ab9317fa9810bf95.tar.gz
cpython-330f1d58282517bdf1f19577ab9317fa9810bf95.tar.bz2
gh-88339: enable fast seeking of uncompressed unencrypted zipfile.ZipExtFile (GH-27737)
Avoid reading all of the intermediate data in uncompressed items in a zip file when the user seeks forward. Contributed by: @JuniorJPDJ
Diffstat (limited to 'Lib/test/test_zipfile.py')
-rw-r--r--Lib/test/test_zipfile.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index fa0ca5a..2125778 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -2032,6 +2032,7 @@ class OtherTests(unittest.TestCase):
fp.seek(bloc, os.SEEK_CUR)
self.assertEqual(fp.tell(), bloc)
self.assertEqual(fp.read(5), txt[bloc:bloc+5])
+ self.assertEqual(fp.tell(), bloc + 5)
fp.seek(0, os.SEEK_END)
self.assertEqual(fp.tell(), len(txt))
fp.seek(0, os.SEEK_SET)
@@ -2049,6 +2050,7 @@ class OtherTests(unittest.TestCase):
fp.seek(bloc, os.SEEK_CUR)
self.assertEqual(fp.tell(), bloc)
self.assertEqual(fp.read(5), txt[bloc:bloc+5])
+ self.assertEqual(fp.tell(), bloc + 5)
fp.seek(0, os.SEEK_END)
self.assertEqual(fp.tell(), len(txt))
fp.seek(0, os.SEEK_SET)