diff --git a/zipstream/__init__.py b/zipstream/__init__.py index a176935..49c6b0d 100644 --- a/zipstream/__init__.py +++ b/zipstream/__init__.py @@ -324,7 +324,8 @@ def __write(self, filename=None, iterable=None, arcname=None, compress_type=None zinfo.compress_size = file_size zinfo.CRC = CRC zinfo.file_size = file_size - if not zip64 and self._allowZip64: + # Run these checks if not running in streaming mode i.e. filename is provided + if not zip64 and self._allowZip64 and filename: if file_size > ZIP64_LIMIT: raise RuntimeError('File size has increased during compressing') if compress_size > ZIP64_LIMIT: