{"record":{"id":"db1baf53de8cba79","repo":"MemPalace/mempalace","slug":"refusing-to-write-config-config-path-is-not-a-r","errorCode":null,"errorMessage":"Refusing to write config: {config_path} is not a regular file","messagePattern":"Refusing to write config: (.+?) is not a regular file","errorType":"exception","errorClass":"OSError","httpStatus":null,"severity":"error","filePath":"mempalace/room_detector_local.py","lineNumber":299,"sourceCode":"\ndef save_config(project_dir: str, project_name: str, rooms: list):\n    config = {\n        \"wing\": project_name,\n        \"rooms\": [\n            {\n                \"name\": r[\"name\"],\n                \"description\": r[\"description\"],\n                \"keywords\": r.get(\"keywords\", [r[\"name\"]]),\n            }\n            for r in rooms\n        ],\n    }\n    config_path = Path(project_dir).expanduser().resolve() / \"mempalace.yaml\"\n    # Opening a pre-existing FIFO for writing blocks in the kernel until a\n    # reader appears. Only a regular file is a valid config target; refuse\n    # loudly rather than park ``init`` with no output.\n    if config_path.exists() and not config_path.is_file():\n        raise OSError(f\"Refusing to write config: {config_path} is not a regular file\")\n    with open(config_path, \"w\") as f:\n        yaml.dump(config, f, default_flow_style=False, sort_keys=False)\n\n    print(f\"\\n  Config saved: {config_path}\")\n    print(\"\\n  Next step:\")\n    print(f\"    mempalace mine {project_dir}\")\n    print(f\"\\n{'=' * 55}\\n\")\n\n\ndef detect_rooms_local(project_dir: str, yes: bool = False):\n    \"\"\"Main entry point for local setup.\"\"\"\n    from .config import normalize_wing_name\n\n    project_path = Path(project_dir).expanduser().resolve()\n    project_name = normalize_wing_name(project_path.name)\n\n    if not project_path.exists():\n        print(f\"ERROR: Directory not found: {project_dir}\")","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/room_detector_local.py#L281-L317","documentation":"Error \"Refusing to write config: {config_path} is not a regular file\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/room_detector_local.py:299 when the library encounters an invalid state.","commonSituations":"Refusing to write config to a non-regular file.","solutions":["Point the config path at a regular file (not a symlink/directory)"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}