MemPalace/mempalace · error · OSError

Refusing to write config: {config_path} is not a regular fil

Error message

Refusing to write config: {config_path} is not a regular file

What it means

Error "Refusing to write config: {config_path} is not a regular file" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/room_detector_local.py:299

def save_config(project_dir: str, project_name: str, rooms: list):
    config = {
        "wing": project_name,
        "rooms": [
            {
                "name": r["name"],
                "description": r["description"],
                "keywords": r.get("keywords", [r["name"]]),
            }
            for r in rooms
        ],
    }
    config_path = Path(project_dir).expanduser().resolve() / "mempalace.yaml"
    # Opening a pre-existing FIFO for writing blocks in the kernel until a
    # reader appears. Only a regular file is a valid config target; refuse
    # loudly rather than park ``init`` with no output.
    if config_path.exists() and not config_path.is_file():
        raise OSError(f"Refusing to write config: {config_path} is not a regular file")
    with open(config_path, "w") as f:
        yaml.dump(config, f, default_flow_style=False, sort_keys=False)

    print(f"\n  Config saved: {config_path}")
    print("\n  Next step:")
    print(f"    mempalace mine {project_dir}")
    print(f"\n{'=' * 55}\n")


def detect_rooms_local(project_dir: str, yes: bool = False):
    """Main entry point for local setup."""
    from .config import normalize_wing_name

    project_path = Path(project_dir).expanduser().resolve()
    project_name = normalize_wing_name(project_path.name)

    if not project_path.exists():
        print(f"ERROR: Directory not found: {project_dir}")

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Point the config path at a regular file (not a symlink/directory)

When it happens

Trigger: Thrown at mempalace/room_detector_local.py:299 when the library encounters an invalid state.

Common situations: Refusing to write config to a non-regular file.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/db1baf53de8cba79. Report an issue: GitHub.