From bd9c5950758f8367288d99852bc6223eec9c8b87 Mon Sep 17 00:00:00 2001 From: Sander Vocke Date: Tue, 30 Apr 2024 16:05:22 +0200 Subject: [PATCH] Update FileIO.py --- src/shoopdaloop/lib/q_objects/FileIO.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shoopdaloop/lib/q_objects/FileIO.py b/src/shoopdaloop/lib/q_objects/FileIO.py index ea0b04dab1..dc90d6bd96 100644 --- a/src/shoopdaloop/lib/q_objects/FileIO.py +++ b/src/shoopdaloop/lib/q_objects/FileIO.py @@ -10,6 +10,7 @@ import math import glob import json +import inspect from PySide6.QtCore import QObject, Slot, Signal, QThread, QMetaObject, Qt from PySide6.QtQml import QJSValue @@ -106,7 +107,10 @@ def make_tarfile(self, filename, source_dir, compress): def extract_tarfile(self, filename, target_dir): flags = "r:*" with tarfile.open(filename, flags) as tar: - tar.extractall(target_dir, filter='fully_trusted') + if 'filter' in inspect.signature(tar.extractall).signature.parameters: + tar.extractall(target_dir, filter='fully_trusted') + else: + tar.extractall(target_dir) def save_data_to_soundfile_impl(self, filename, sample_rate, data): self.startSavingFile.emit()