From e0463ef0c4d1a59cc4dc55cbaa6a8e02484110d2 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 30 Jun 2021 00:55:21 +0100 Subject: [PATCH] Ignore non-ascii chars in options (Damn you smart-quotes) --- bridge_master.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge_master.py b/bridge_master.py index caf49ed..041eb03 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -647,6 +647,7 @@ def options_config(): if 'OPTIONS' in CONFIG['SYSTEMS'][_system]: _options = {} CONFIG['SYSTEMS'][_system]['OPTIONS'] = CONFIG['SYSTEMS'][_system]['OPTIONS'].rstrip('\x00') + CONFIG['SYSTEMS'][_system]['OPTIONS'] = CONFIG['SYSTEMS'][_system]['OPTIONS'].encode('ascii', 'ignore').decode() CONFIG['SYSTEMS'][_system]['OPTIONS'] = re.sub("\'","",CONFIG['SYSTEMS'][_system]['OPTIONS']) CONFIG['SYSTEMS'][_system]['OPTIONS'] = re.sub("\"","",CONFIG['SYSTEMS'][_system]['OPTIONS']) for x in CONFIG['SYSTEMS'][_system]['OPTIONS'].split(";"): @@ -824,7 +825,7 @@ def options_config(): CONFIG['SYSTEMS'][_system]['DEFAULT_REFLECTOR'] = int(_options['DEFAULT_REFLECTOR']) CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER'] = int(_options['DEFAULT_UA_TIMER']) except Exception: - logger.exception('(OPTIONS) caught exception: %s',CONFIG['SYSTEMS'][_system]) + logger.exception('(OPTIONS) caught exception:') continue def mysqlGetConfig():