From e1f0fc7e8910d57a6a0d5704f59bde0040536595 Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Wed, 7 Aug 2024 23:36:48 -0700 Subject: [PATCH] Fix #101: Dashes in the names of PSA config keys results in parsing errors The issue here was the regex pattern was too restrictive, so it did not pick up the lines as ones that needed to have the `=` appended at the end so that the ConfigParser could properly parse the file. --- io_scene_psk_psa/psa/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_scene_psk_psa/psa/config.py b/io_scene_psk_psa/psa/config.py index 66864e4..80133bc 100644 --- a/io_scene_psk_psa/psa/config.py +++ b/io_scene_psk_psa/psa/config.py @@ -28,7 +28,7 @@ def _load_config_file(file_path: str) -> ConfigParser: with open(file_path, 'r') as f: lines = f.read().split('\n') - lines = [re.sub(r'^\s*(\w+)\s*$', r'\1=', line) for line in lines] + lines = [re.sub(r'^\s*([^=]+)\s*$', r'\1=', line) for line in lines] contents = '\n'.join(lines)