From 0eb605219b7184db4a2df8bcd93dcaed3dcb9997 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 31 Aug 2017 15:14:47 -0700 Subject: [PATCH] conf: use splitext() to fetch the config name This fixes incorrect behaviour when there are multiple .'s in the config filename (e.g. '1.2.3.yml' got truncated to confname='1') --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 85c0bdc..fdbb629 100644 --- a/conf.py +++ b/conf.py @@ -115,7 +115,7 @@ def loadConf(filename, errors_fatal=True, logger=None): # Note: store globally the last loaded conf filename, for REHASH in coremods/control. fname = filename # For the internal config name, strip off any .yml extensions and absolute paths - confname = os.path.basename(filename).split('.', 1)[0] + confname = os.path.splitext(os.path.basename(filename))[0] try: with open(filename, 'r') as f: conf = yaml.load(f)