mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-26 22:49:01 -06:00
Use mkstemp
This commit is contained in:
@@ -5,8 +5,8 @@ import shutil
|
|||||||
import uuid
|
import uuid
|
||||||
import zipfile
|
import zipfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import NamedTemporaryFile
|
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
from tempfile import mkstemp
|
||||||
|
|
||||||
import tqdm
|
import tqdm
|
||||||
from celery import Task
|
from celery import Task
|
||||||
@@ -663,12 +663,8 @@ def build_share_link_bundle(bundle_id: int):
|
|||||||
|
|
||||||
documents = list(bundle.documents.all().order_by("pk"))
|
documents = list(bundle.documents.all().order_by("pk"))
|
||||||
|
|
||||||
with NamedTemporaryFile(
|
_, temp_zip_path_str = mkstemp(suffix=".zip", dir=settings.SCRATCH_DIR)
|
||||||
dir=settings.SCRATCH_DIR,
|
temp_zip_path = Path(temp_zip_path_str)
|
||||||
suffix=".zip",
|
|
||||||
delete=False,
|
|
||||||
) as temp_zip:
|
|
||||||
temp_zip_path = Path(temp_zip.name)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
strategy_class = (
|
strategy_class = (
|
||||||
|
|||||||
Reference in New Issue
Block a user