From 1339cbb2e104c1571559c91b565d430de4a87316 Mon Sep 17 00:00:00 2001 From: David Huss <dh@atoav.com> Date: Sun, 31 Oct 2021 15:35:48 +0100 Subject: [PATCH] Try priviledge escalation --- common_config/__init__.py | 2 +- common_config/common.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common_config/__init__.py b/common_config/__init__.py index 8389fb7..c01c06d 100644 --- a/common_config/__init__.py +++ b/common_config/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.1.12' +__version__ = '0.1.13' from common_config.common import * \ No newline at end of file diff --git a/common_config/common.py b/common_config/common.py index 8c9b07f..577bd96 100644 --- a/common_config/common.py +++ b/common_config/common.py @@ -425,7 +425,7 @@ def create_config(): config_path.write_text(DEFAULT_CONFIG) except PermissionError as e: python_path = f"{sys.prefix}/bin/python3" - script_path = f"{os.getcwd()}" + script_path = f"{inspect.stack()[0][1]}" print() print(f"Error: Didn't have the permissions to write the file to {config_path}", file=sys.stderr) print(f" Directory \"{selection['path']}\" belongs to user {selection['path'].owner()} (was running as user {getpass.getuser()})", file=sys.stderr) diff --git a/pyproject.toml b/pyproject.toml index 86cc2af..6690eae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "common-config" -version = "0.1.12" +version = "0.1.13" description = "A config library for eigenservice" authors = ["David Huss <dh@atoav.com>"] -- GitLab