You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo commands: --cache-dir naming a regular file exits 1 with a bare [Errno 17] File exists, not exit 2 naming the flag #765
The repo commands pass --cache-dir to open_source (dokimi/dokimi/commands/repo.py:624_cache_dir), which calls ensure_clone (dokimi/dokimi/repos/source.py:487, cache_dir.mkdir(parents=True, exist_ok=True)) for a remote source.
Repro: python cli.py repo fetch file:///tmp/nothere@HEAD --cache-dir /tmp/cachefile, where /tmp/cachefile is a regular file. Output: ✗ [Errno 17] File exists: '/tmp/cachefile', exit 1 (with --json: "status": "failed", "reason": "exit 1: see stderr"). Calling ensure_clone(url, Path('/tmp/cachefile')) directly raises FileExistsError. There is no traceback, but a bad flag value reads as a failed run: the message does not name --cache-dir, and the exit code is 1 where bad input is 2.
The same cause as #701 (an unusable cache directory reaching an unguarded mkdir), in a different cache.
Fix options: validate --cache-dir in _cache_dir and raise InputError naming the flag and path (the check usable_cache_dir in commands/novelty_run.py can move to a shared place and be reused), or catch OSError in ensure_clone and re-raise as SourceError naming the directory. The first fails before any clone starts.
Activity