From d6611774f3f5755d10f96c0b998ad67f0da7a99b Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Tue, 22 Jun 2021 11:50:22 -0300 Subject: [PATCH] Fixed plist access denied files on .exe --- invesalius/control.py | 2 +- invesalius/data/volume.py | 2 +- invesalius/presets.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index bf1fe66..30ba8bf 100644 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -1085,7 +1085,7 @@ class Controller(): if not os.path.isfile(path): path = os.path.join(inv_paths.USER_RAYCASTING_PRESETS_DIRECTORY, preset_name+".plist") - with open(path, 'r+b') as f: + with open(path, 'rb') as f: preset = plistlib.load(f, fmt=plistlib.FMT_XML) prj.Project().raycasting_preset = preset # Notify volume diff --git a/invesalius/data/volume.py b/invesalius/data/volume.py index 829a741..8d89d32 100644 --- a/invesalius/data/volume.py +++ b/invesalius/data/volume.py @@ -356,7 +356,7 @@ class Volume(): if color_preset != "No CLUT": path = os.path.join(inv_paths.RAYCASTING_PRESETS_DIRECTORY, 'color_list', color_preset + '.plist') - with open(path, 'r+b') as f: + with open(path, 'rb') as f: p = plistlib.load(f, fmt=plistlib.FMT_XML) r = p['Red'] diff --git a/invesalius/presets.py b/invesalius/presets.py index 67f38c7..14f2e47 100644 --- a/invesalius/presets.py +++ b/invesalius/presets.py @@ -155,7 +155,7 @@ class Presets(): "Custom":_("Custom")} - with open(filename, 'r+b') as f: + with open(filename, 'rb') as f: p = plistlib.load(f, fmt=plistlib.FMT_XML) thresh_mri = p['thresh_mri'].copy() thresh_ct = p['thresh_ct'].copy() @@ -183,7 +183,7 @@ def get_wwwl_presets(): def get_wwwl_preset_colours(pfile): - with open(pfile, 'r+b') as f: + with open(pfile, 'rb') as f: preset = plistlib.load(f, fmt=plistlib.FMT_XML) ncolours = len(preset['Blue']) colours = [] -- libgit2 0.21.2