mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Fix bytes between entries be removed when removed is passed
This commit is contained in:
parent
926338cbc1
commit
e76f9a1bc1
2 changed files with 6 additions and 0 deletions
|
|
@ -1846,6 +1846,7 @@ def test_repack_bytes_between_files(self):
|
|||
for i, (file, data) in enumerate(self.test_files):
|
||||
zh.writestr(file, data)
|
||||
fh.write(b' dummy bytes ')
|
||||
zh.start_dir = fh.tell()
|
||||
with zipfile.ZipFile(TESTFN, 'a', self.compression) as zh:
|
||||
for i in ii:
|
||||
zh.remove(self.test_files[i][0])
|
||||
|
|
@ -2168,6 +2169,7 @@ def test_repack_removed_bytes_between_files(self):
|
|||
zh.writestr(file, data)
|
||||
expected_zinfos.append(ComparableZipInfo(zh.getinfo(file)))
|
||||
fh.write(b' dummy bytes ')
|
||||
zh.start_dir = fh.tell()
|
||||
expected_size = os.path.getsize(TESTFN)
|
||||
|
||||
# do the removal and check the result
|
||||
|
|
@ -2176,6 +2178,7 @@ def test_repack_removed_bytes_between_files(self):
|
|||
for i, (file, data) in enumerate(self.test_files):
|
||||
zh.writestr(file, data)
|
||||
fh.write(b' dummy bytes ')
|
||||
zh.start_dir = fh.tell()
|
||||
with zipfile.ZipFile(TESTFN, 'a', self.compression) as zh:
|
||||
zinfos = [zh.remove(self.test_files[i][0]) for i in ii]
|
||||
zh.repack(zinfos)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue