disable interpolation for config reader

This caused strings whith the '%' character in it to be interpreted by
Python's ConfigParser. This behavior is not needed for DashMachine,
the goal is to read exactly what the user types.

Setting interpolation to None fixes this.

See: https://docs.python.org/3/library/configparser.html?highlight=configparser#interpolation-of-values
This commit is contained in:
Guillaume Taquet Gasperini 2020-04-02 18:55:00 +02:00
parent 7d98bc437b
commit e9dac3c31a

View File

@ -22,7 +22,7 @@ def row2dict(row):
def read_config(): def read_config():
config = ConfigParser() config = ConfigParser(interpolation=None)
try: try:
config.read(os.path.join(user_data_folder, "config.ini")) config.read(os.path.join(user_data_folder, "config.ini"))
except Exception as e: except Exception as e: