Back to Signal Feed
CodeTracked since May 19, 2026

Handle OSError in aider path checks to prevent crashes on invalid or overlong filenames

Aider now wraps `Path(...).is_dir()`/`resolve()` calls in three `main.py` validation paths with `try/except OSError`, so malformed or overlong paths (including those arising from large `--system-prompt` values) no longer crash the CLI with tracebacks and instead emit a warning and continue.

Path.is_dir()OSErrorENAMETOOLONGaider/main.py

What Happened

  • Aider now wraps `Path(...).is_dir()`/`resolve()` calls in three `main.py` validation paths with `try/except OSError`, so malformed or overlong paths (including those arising from large `--system-prompt` values) no longer crash the CLI with tracebacks and instead emit a warning and continue.
  • Aider now wraps `Path(...).is_dir()`/`resolve()` calls in three `main.py` validation paths with `try/except OSError`, so malformed or overlong paths (including those arising from large `--system-prompt` values) no longer crash the CLI with tracebacks and instead emit a warning and continue.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Added explicit OSError handling around directory checks and path resolution in `read_only_fnames`, multi-file validation, and single-directory detection, converting hard failures into graceful invalid-path warnings.

Why Track This

Why It Matters

Aider users who pass very long or malformed path arguments—especially via command-line prompts—will avoid abrupt crashes, so their sessions keep running while the tool surfaces a warning and skips only the bad path. This is implemented by catching `OSError` in the three `Path(fname).is_dir()`/`resolve()` branches in `main.py`; follow whether the warning-based skip behavior causes any important files to be silently ignored and whether other path-handling code paths still raise uncaught filesystem exceptions.

Impact

Aider users who pass very long or malformed path arguments—especially via command-line prompts—will avoid abrupt crashes, so their sessions keep running while the tool surfaces a warning and skips only the bad path. This is implemented by catching `OSError` in the three `Path(fname).is_dir()`/`resolve()` branches in `main.py`; follow whether the warning-based skip behavior causes any important files to be silently ignored and whether other path-handling code paths still raise uncaught filesystem exceptions.

What To Watch Next

  • Watch whether Path.is_dir() becomes a repeated pattern.
  • Track follow-up changes around AI IDE.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: path_errors_other_code_paths, invalid_inputs_marked_as_warnings_only.
Open Topic TimelineOpen Technical EventOpen Original Sourcepath_errors_other_code_paths / invalid_inputs_marked_as_warnings_only / skipped_files_reduce_operator_visibility

Supporting Evidence