From c991795f0d9193d2a9431619e7534a6e69aa6237 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 15 Feb 2020 21:57:05 +0100 Subject: [PATCH] Some additional tweaks for Windows --- nw/config.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nw/config.py b/nw/config.py index 9aa7e6d8..a932553e 100644 --- a/nw/config.py +++ b/nw/config.py @@ -167,7 +167,7 @@ class Config: if confPath is None: confRoot = QStandardPaths.writableLocation(QStandardPaths.ConfigLocation) - self.confPath = path.join(confRoot, self.appHandle) + self.confPath = path.join(path.abspath(confRoot), self.appHandle) else: logger.info("Setting config from alternative path: %s" % confPath) self.confPath = confPath @@ -186,12 +186,13 @@ class Config: # If config folder does not exist, make it. # This assumes that the os config folder itself exists. - if self.osWindows: - if not path.isdir(self.confPath): - makedirs(self.confPath) - else: - if not path.isdir(self.confPath): + if not path.isdir(self.confPath): + try: mkdir(self.confPath) + except Exception as e: + logger.error("Could not create folder: %s" % self.confPath) + logger.error(str(e)) + return False # Check if config file exists if path.isfile(path.join(self.confPath,self.confFile)):