From 34c9b4514d47e6d53b702e9e93b1699e040ae0b3 Mon Sep 17 00:00:00 2001 From: Karl G Date: Sat, 19 Feb 2022 13:17:29 +0100 Subject: [PATCH] fix strange bug when SpooledTemporaryFile seems to be not seekable on debian 10 python3 Just use TemporaryFile --- publisher/worker/collector.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/publisher/worker/collector.py b/publisher/worker/collector.py index 8bd2995..b4d2b97 100644 --- a/publisher/worker/collector.py +++ b/publisher/worker/collector.py @@ -34,17 +34,16 @@ def collect(self, url, working_dir): def _downloadData(self, url): """ - Downloads the related content/data from the publisher instance and - stores it in memory. + Downloads the related content/data from the publisher instance Returns the file object of the download file """ logger.debug("Downloading file from: %s" % url) with self._open_url(url) as url_file: - mem_puffer = tempfile.SpooledTemporaryFile() - mem_puffer.write(url_file.read()) - mem_puffer.seek(0) - return mem_puffer + temp_file = tempfile.TemporaryFile() + temp_file.write(url_file.read()) + temp_file.seek(0) + return temp_file def _validateData(self, zdata): """