Skip to content

Commit

Permalink
handle missing path keys in load_config
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisvang committed Jun 11, 2024
1 parent 9e108a7 commit 42407b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tufup/repo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,9 @@ def load_config(cls) -> dict:
logger.warning(f'config file invalid: {file_path}')
# force posix paths (in case legacy windows config is loaded on linux, see #147)
for key in ['repo_dir', 'keys_dir']:
config_dict[key] = pathlib.Path(config_dict[key]).as_posix()
value = config_dict.get(key)
if value:
config_dict[key] = pathlib.Path(value).as_posix()
return config_dict

@classmethod
Expand Down

0 comments on commit 42407b0

Please sign in to comment.