Use a NamedTemporaryFile instead of TemporaryFile for streamed gzip files

This commit is contained in:
Micah Lee 2021-11-18 20:17:39 -08:00
parent f5b60de2e6
commit b659eccfbf
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -194,7 +194,7 @@ class SendBaseModeWeb:
if use_gzip:
if filesystem_path not in self.gzip_individual_files:
self.gzip_files.append(
tempfile.TemporaryFile("wb+", dir=self.common.build_tmp_dir())
tempfile.NamedTemporaryFile("wb+", dir=self.common.build_tmp_dir())
)
gzip_file = self.gzip_files[-1]
self._gzip_compress(filesystem_path, gzip_file.name, 6, None)