From 6109d60052fe5bc94ad15ed5f446b5d7d0d80451 Mon Sep 17 00:00:00 2001 From: marcsello Date: Thu, 30 Apr 2020 00:45:15 +0200 Subject: [PATCH] Fixed tempfile creation again --- extractor_service/extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extractor_service/extraction.py b/extractor_service/extraction.py index 81c3be3..cef1ff4 100644 --- a/extractor_service/extraction.py +++ b/extractor_service/extraction.py @@ -55,7 +55,7 @@ def run_everything(parameters: dict): tag = parameters['tag'] logging.info(f"Downloading sample: {tag}") - file_path = tempfile.mktemp(prefix=f"{tag}_", suffix=".wav", dir="extractor-service") + _, file_path = tempfile.mkstemp(prefix=f"{tag}_", suffix=".wav") r = requests.get(f"http://storage-service/object/{tag}") with open(file_path, 'wb') as f: f.write(r.content)