Skip to content

fix: report command permission errors without a traceback - #746

Open
Kulraj69 wants to merge 2 commits into
theskumar:mainfrom
Kulraj69:fix/run-command-permission-errors
Open

Kulraj69 wants to merge 2 commits into
theskumar:mainfrom
Kulraj69:fix/run-command-permission-errors

Conversation

@Kulraj69

Copy link
Copy Markdown

Problem: dotenv run handles missing commands cleanly, but a non-executable file or directory raises an uncaught PermissionError.

Change: catch PermissionError in the POSIX execvpe and Windows Popen paths, print "Permission denied: " to stderr, and exit with status 1. Other launch errors keep their current behavior.

Tests: four new regressions fail before the fix and pass after it. Real POSIX subprocess checks cover a non-executable file and a directory; mocked checks cover both platform branches. Native Windows was not tested. Full suite: 294 passed, with 32 existing Click deprecation warnings. Ruff and changed-file formatting pass.

The full run used a controlled PATH because the inherited PATH contained an inaccessible directory. The same missing-command test failed on unchanged upstream with that PATH; no upstream test was changed.

AI-assisted implementation and testing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant