mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-14 13:41:25 -05:00
Use NamedTemporaryFile instead of TemporaryFile, to fix crash when sharing one file
This commit is contained in:
parent
c80303df35
commit
926359de3c
@ -467,7 +467,7 @@ class ShareModeWeb(SendBaseModeWeb):
|
|||||||
return self.web.error404(history_id)
|
return self.web.error404(history_id)
|
||||||
|
|
||||||
def build_zipfile_list(self, filenames, processed_size_callback=None):
|
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:
|
for filename in filenames:
|
||||||
info = {
|
info = {
|
||||||
"filename": filename,
|
"filename": filename,
|
||||||
@ -492,7 +492,7 @@ class ShareModeWeb(SendBaseModeWeb):
|
|||||||
self.download_etag = make_etag(f)
|
self.download_etag = make_etag(f)
|
||||||
|
|
||||||
# Compress the file with gzip now, so we don't have to do it on each request
|
# 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()
|
"wb+", dir=self.common.build_tmp_dir()
|
||||||
)
|
)
|
||||||
self._gzip_compress(
|
self._gzip_compress(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user