From 791723db204f7df4da862f1aeb98a325835c8aa4 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 9 Jun 2021 11:52:49 -0700 Subject: [PATCH] GlobalCommon does not need temp dirs, and fix bug with finding Mac PFD viewers --- dangerzone/global_common.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/dangerzone/global_common.py b/dangerzone/global_common.py index 3310b59..0f74a6e 100644 --- a/dangerzone/global_common.py +++ b/dangerzone/global_common.py @@ -32,17 +32,6 @@ class GlobalCommon(object): # Qt app self.app = app - # Temporary directory to store pixel data - # Note in macOS, temp dirs must be in /tmp (or a few other paths) for Docker to mount them - if platform.system() == "Windows": - self.pixel_dir = tempfile.TemporaryDirectory(prefix="dangerzone-pixel-") - self.safe_dir = tempfile.TemporaryDirectory(prefix="dangerzone-safe-") - else: - self.pixel_dir = tempfile.TemporaryDirectory( - prefix="/tmp/dangerzone-pixel-" - ) - self.safe_dir = tempfile.TemporaryDirectory(prefix="/tmp/dangerzone-safe-") - # Name of input file self.document_filename = None @@ -367,7 +356,9 @@ class GlobalCommon(object): continue with open(plist_path, "rb") as f: - plist_dict = plistlib.load(plist_path) + plist_data = f.read() + + plist_dict = plistlib.loads(plist_data) if ( plist_dict.get("CFBundleName")