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.
This commit is contained in:
@@ -28,7 +28,7 @@ def _load_config_file(file_path: str) -> ConfigParser:
|
|||||||
with open(file_path, 'r') as f:
|
with open(file_path, 'r') as f:
|
||||||
lines = f.read().split('\n')
|
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)
|
contents = '\n'.join(lines)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user