1
0
Fork 0
mirror of https://github.com/Thor77/TeamspeakStats.git synced 2025-07-08 00:18:43 -04:00

Use RawConfigParser instead of ConfigParser in tsstats.config

because General.datetimeformat creates problems with string-interpolation.
These are solved by swichting to RawConfigParser, which doesn't support this feature.
This commit is contained in:
Thor77 2016-09-17 22:42:32 +02:00
parent 52fc1b487c
commit 799f622201

View file

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
try: try:
from configparser import ConfigParser from configparser import RawConfigParser
except ImportError: except ImportError:
from ConfigParser import ConfigParser from ConfigParser import RawConfigParser
import logging import logging
@ -34,7 +34,7 @@ def load(path=None):
:rtype: tuple :rtype: tuple
''' '''
logger.debug('reading config') logger.debug('reading config')
config = ConfigParser() config = RawConfigParser()
# use this way to set defaults, because ConfigParser.read_dict # use this way to set defaults, because ConfigParser.read_dict
# is not available < 3.2 # is not available < 3.2
for section, items in DEFAULT_CONFIG.items(): for section, items in DEFAULT_CONFIG.items():