From 2337e61b711f10b2c7d48de97c17fa3b967f71db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 8 Feb 2025 14:35:59 +0100 Subject: [PATCH] Skip empty filename as configuration file --- trytond/trytond/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trytond/trytond/config.py b/trytond/trytond/config.py index 78d768b393..abe651f05b 100644 --- a/trytond/trytond/config.py +++ b/trytond/trytond/config.py @@ -117,11 +117,15 @@ class TrytonConfigParser(configparser.ConfigParser): self.set(section, option, value) def update_etc(self, configfile=os.environ.get('TRYTOND_CONFIG')): + if not configfile: + return [] if isinstance(configfile, str): configfile = [configfile] - if not configfile or not [_f for _f in configfile if _f]: + configfile = [ + os.path.expanduser(filename) for filename in configfile + if filename] + if not configfile: return [] - configfile = [os.path.expanduser(filename) for filename in configfile] read_files = self.read(configfile) logger.info('using %s as configuration files', ', '.join(read_files)) if configfile != read_files: