Skip to content

Commit 2ebe493

Browse files
committed
Merge pull request #16 from lesthaeghet/master
Bugfix for #15 for compressing large files
2 parents d45fd94 + da7d3ed commit 2ebe493

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

zipstream/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ def __write(self, filename=None, iterable=None, arcname=None, compress_type=None
262262
else:
263263
zinfo.compress_type = compress_type
264264

265-
zinfo.file_size = 0
265+
if st:
266+
zinfo.file_size = st[6]
267+
else:
268+
zinfo.file_size = 0
266269
zinfo.flag_bits = 0x00
267270
zinfo.flag_bits |= 0x08 # ZIP flag bits, bit 3 indicates presence of data descriptor
268271
zinfo.header_offset = self.fp.tell() # Start of header bytes

0 commit comments

Comments
 (0)