affaan-m/ECC · error · ValueError

Path is not a valid directory: {canonical!r}

Error message

Path is not a valid directory: {canonical!r}

What it means

Error "Path is not a valid directory: {canonical!r}" thrown in affaan-m/ECC.

Source

Thrown at scripts/lib/ecc_dashboard_runtime.py:68

                'cwd': path,
                'creationflags': creationflags,
            },
        )

    if resolved_system_name == 'Darwin':
        return (['open', '-a', 'Terminal', path], {})

    return (
        ['x-terminal-emulator', '-e', 'bash', '-lc', 'cd -- "$1"; exec bash', 'bash', path],
        {},
    )


def launch_terminal(path: str) -> None:
    """Open a terminal at the given path after validating the target directory."""
    canonical = os.path.realpath(path)
    if not os.path.isdir(canonical):
        raise ValueError(f"Path is not a valid directory: {canonical!r}")
    argv, kwargs = build_terminal_launch(canonical)
    subprocess.Popen(argv, **kwargs)  # noqa: S603 - list argv, no shell=True, path validated above

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Pass a path to an existing directory; the path is canonicalized with realpath before the check, so fix symlinks or typos.
  2. Create the directory first, or launch the terminal at an existing parent directory.

Example fix

launch_terminal(os.path.realpath(os.path.expanduser('~/project')))  # must exist and be a directory

When it happens

Trigger: Thrown at scripts/lib/ecc_dashboard_runtime.py:68 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/b2ad29dbae5b1bfd. Report an issue: GitHub.