diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-10-06 14:07:32 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-10-06 14:07:32 -0400 |
commit | c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1 (patch) | |
tree | e0322eb29e5acab5d43ffb7bd76262735a8a7850 | |
parent | cc63fd51b226f86aa684342241c20e2e2b84f8da (diff) | |
download | kutter-c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1.tar.gz kutter-c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1.tar.xz kutter-c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1.zip |
configfile: Ignore trailing comments starting with a semicolon
Newer versions of configparser no longer default to ignoring trailing
comments that start with a semicolon. Add that setting explicitly to
avoid breaking existing config files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/configfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py index 71f5ca60..55aed295 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -255,7 +255,8 @@ class PrinterConfig: self._parse_config_buffer(buffer, filename, fileconfig) visited.remove(path) def _build_config_wrapper(self, data, filename): - fileconfig = configparser.RawConfigParser(strict=False) + fileconfig = configparser.RawConfigParser( + strict=False, inline_comment_prefixes=(';','#')) self._parse_config(data, filename, fileconfig, set()) return ConfigWrapper(self.printer, fileconfig, {}, 'printer') def _build_config_string(self, config): |