theskumar / python-dotenv

Reads key-value pairs from a .env file and can set them as environment variables. It helps in developing applications following the 12-factor principles.
https://saurabh-kumar.com/python-dotenv/
BSD 3-Clause "New" or "Revised" License
7.7k stars 431 forks source link

Unreleased `dotenv run` changes do not work on Windows #536

Open MrSnapperVibes opened 1 month ago

MrSnapperVibes commented 1 month ago

Commit https://github.com/theskumar/python-dotenv/commit/4543837fc674f82f131c6a1e0e7e897461feaffd breaks the dotenv run command on Windows. If you enter the statement (for example) dotenv run -- python in Powershell there is no output. Subsequently entering $? reveals the last statement failed.

If I run python -c "import os; os.execvpe('python', ['python'], {})" I get the output FileNotFoundError: [Errno 2] No such file or directory: 'C:\\bin\\python'. I imagine this same error is occurring with the dotenv run command but the error message is getting lost.