(path: str, data: dict[str, Any])
| 277 | |
| 278 | |
| 279 | def _write_json(path: str, data: dict[str, Any]) -> bool: |
| 280 | try: |
| 281 | os.makedirs(os.path.dirname(path) or ".", exist_ok=True) |
| 282 | with open(path, "w") as f: |
| 283 | json.dump(data, f, indent=2) |
| 284 | return True |
| 285 | except OSError: |
| 286 | log.error("failed to persist settings to %s", path) |
| 287 | return False |
| 288 | |
| 289 | |
| 290 | def persist_permission_update( |
no test coverage detected