From 2a228b03e15155cd1e7ba1f06c8c0bf4fee5571d Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Fri, 2 Dec 2016 19:13:13 +0200 Subject: [PATCH] Fix path parts in value substitutions --- pupy/pupylib/PupyConfig.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pupy/pupylib/PupyConfig.py b/pupy/pupylib/PupyConfig.py index 4856a2dc..005c4f20 100644 --- a/pupy/pupylib/PupyConfig.py +++ b/pupy/pupylib/PupyConfig.py @@ -6,6 +6,7 @@ except ImportError: from os import path, makedirs from netaddr import IPAddress +import platform class PupyConfig(ConfigParser): def __init__(self, config='pupy.conf'): @@ -36,6 +37,9 @@ class PupyConfig(ConfigParser): retfolder = path.join(self.user_root, folder) for key, value in substitutions.iteritems(): + value = value.replace('/', '_').replace('..', '_') + if platform.system == 'Windows': + value = value.replace(':', '_') retfolder = retfolder.replace(key, value) if path.isdir(retfolder):