From d95b34a9075cd5f1231a876ff45041dd65da980e Mon Sep 17 00:00:00 2001 From: l3uddz Date: Tue, 13 Mar 2018 13:49:06 +0000 Subject: [PATCH] use realpath for config/logfile, allows symlinks to operate as expected. --- misc/config.py | 2 +- misc/log.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/config.py b/misc/config.py index 0525488..e465c08 100644 --- a/misc/config.py +++ b/misc/config.py @@ -4,7 +4,7 @@ import sys from attrdict import AttrDict -config_path = os.path.join(os.path.dirname(sys.argv[0]), 'config.json') +config_path = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'config.json') base_config = { 'core': { 'debug': False diff --git a/misc/log.py b/misc/log.py index 28e12f1..204c448 100644 --- a/misc/log.py +++ b/misc/log.py @@ -30,7 +30,7 @@ class Logger: if file_name: if os.path.sep not in file_name: # file_name was a filename, lets build a full file_path - self.log_file_path = os.path.join(os.path.dirname(sys.argv[0]), file_name) + self.log_file_path = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), file_name) else: self.log_file_path = file_name