From 453b6becaef90d4f77ae056a39c91ed7d9c9f864 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 21 Sep 2023 01:18:15 +0200 Subject: [PATCH] FIX: We shouldn't expand `cfgfile` if it's empty. --- platypush/config/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index bf3774e1..df09e5f7 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -106,7 +106,9 @@ class Config: if cfgfile is None: cfgfile = self._get_default_cfgfile() - cfgfile = os.path.abspath(os.path.expanduser(cfgfile)) + if cfgfile: + cfgfile = os.path.abspath(os.path.expanduser(cfgfile)) + if cfgfile is None or not os.path.exists(cfgfile): cfgfile = self._create_default_config(cfgfile)