@@ -3464,15 +3464,15 @@ def read(self, size=-1):
3464
3464
# 20000 bytes
3465
3465
txt = b'0123456789' * 2000
3466
3466
3467
- # The seek length must be greater than ZipExtFile.MIN_READ_SIZE (4096)
3468
- # as `ZipExtFile._read2()` reads in blocks of this size and we need to
3469
- # seek out of the buffered data
3467
+ # The seek length must be greater than ZipExtFile.MIN_READ_SIZE
3468
+ # as `ZipExtFile._read2()` reads in blocks of this size and we
3469
+ # need to seek out of the buffered data
3470
3470
min_size = zipfile .ZipExtFile .MIN_READ_SIZE
3471
- self .assertGreaterEqual (10002 , min_size )
3472
- self .assertGreaterEqual (5003 , min_size )
3471
+ self .assertGreaterEqual (10002 , min_size ) # for forward seek test
3472
+ self .assertGreaterEqual (5003 , min_size ) # for backward seek test
3473
3473
# The read length must be less than MIN_READ_SIZE, since we assume that
3474
3474
# only 1 block is read in the test.
3475
- self .assertGreaterEqual (min_size , 100 )
3475
+ self .assertGreaterEqual (min_size , 100 ) # for read() calls
3476
3476
3477
3477
with zipfile .ZipFile (sio , "w" , compression = zipfile .ZIP_STORED ) as zipf :
3478
3478
zipf .writestr ("foo.txt" , txt )
@@ -3498,7 +3498,7 @@ def read(self, size=-1):
3498
3498
# backward seek
3499
3499
old_count = sio .bytes_read
3500
3500
fp .seek (- 5003 , os .SEEK_CUR )
3501
- self .assertEqual (fp .tell (), 5099 )
3501
+ self .assertEqual (fp .tell (), 5099 ) # 5099 = 10102 - 5003
3502
3502
self .assertEqual (fp ._left , fp ._compress_left )
3503
3503
arr = fp .read (100 )
3504
3504
self .assertEqual (fp .tell (), 5199 )
0 commit comments