(config_type: str, path: Path)
| 63 | |
| 64 | |
| 65 | def read_raw_config(config_type: str, path: Path) -> Dict[str, Any]: |
| 66 | try: |
| 67 | with path.open(encoding=UTF8) as f: |
| 68 | try: |
| 69 | return json.load(f) |
| 70 | except ValueError as e: |
| 71 | raise ConfigFileError( |
| 72 | f'invalid {config_type} file: {e} [{path}]' |
| 73 | ) |
| 74 | except FileNotFoundError: |
| 75 | pass |
| 76 | except OSError as e: |
| 77 | raise ConfigFileError(f'cannot read {config_type} file: {e}') |
| 78 | |
| 79 | |
| 80 | class BaseConfigDict(dict): |
no test coverage detected