mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 03:37:28 -03:00
Use NamedTemporaryFile instead of TemporaryFile, to fix crash when sharing one file
This commit is contained in:
parent
b659eccfbf
commit
109d63a10c
1 changed files with 2 additions and 2 deletions
|
@ -467,7 +467,7 @@ class ShareModeWeb(SendBaseModeWeb):
|
|||
return self.web.error404(history_id)
|
||||
|
||||
def build_zipfile_list(self, filenames, processed_size_callback=None):
|
||||
self.common.log("ShareModeWeb", "build_zipfile_list")
|
||||
self.common.log("ShareModeWeb", "build_zipfile_list", f"filenames={filenames}")
|
||||
for filename in filenames:
|
||||
info = {
|
||||
"filename": filename,
|
||||
|
@ -492,7 +492,7 @@ class ShareModeWeb(SendBaseModeWeb):
|
|||
self.download_etag = make_etag(f)
|
||||
|
||||
# Compress the file with gzip now, so we don't have to do it on each request
|
||||
self.gzip_file = tempfile.TemporaryFile(
|
||||
self.gzip_file = tempfile.NamedTemporaryFile(
|
||||
"wb+", dir=self.common.build_tmp_dir()
|
||||
)
|
||||
self._gzip_compress(
|
||||
|
|
Loading…
Reference in a new issue