chiark / gitweb /
comment re comments re
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Apr 2017 10:13:54 +0000 (11:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Apr 2017 10:13:54 +0000 (11:13 +0100)
hippotat/__init__.py

index d0cc799..60b779f 100644 (file)
@@ -405,8 +405,9 @@ def process_cfg_clients(constructor):
 #---------- startup ----------
 
 def common_startup(process_cfg):
-  re = regexp.compile('#.*')
-  cfg.read_string(re.sub('', defcfg))
+  # ConfigParser hates #-comments after values
+  trailingcomments_re = regexp.compile('#.*')
+  cfg.read_string(trailingcomments_re.sub('', defcfg))
   need_defcfg = True
 
   def readconfig(pathname, mandatory=True):