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
dotenv run ignores mixed-case Path overrides on Windows #761
On native Windows, .env environment names differing only by case do not override the same inherited variable in dotenv run's effective environment. In particular, Path and path do not participate in the PATH lookup added by #742, although Windows environment names are case-insensitive.
Reproduced on main 4fbc6ff, Windows / CPython 3.13.13:
Put a harmless executable with a unique name in a tools directory absent from the parent PATH (I copied cmd.exe to dotenv-case-probe.exe).
Write PATH='C:/path/to/tools' in .env. dotenv run -- dotenv-case-probe /c echo PATH_CASE_OK prints the marker and exits 0.
Change only the key to Path, then to path. Both calls instead exit 1 with Command not found: dotenv-case-probe.
run_command copies os.environ (which normalizes names to uppercase on Windows), then updates an ordinary case-sensitive dictionary with the .env mapping. This leaves both PATH and Path in that dictionary, and cmd_env.get("PATH") still returns the inherited value. Windows can resolve the duplicate names when creating the child process, but that happens after this explicit executable lookup.
I checked #373/#730/#742 and #749. They address executable resolution and a failed lookup's fallback, not environment-key casing. I plan to normalize the added names only in the Windows branch, retain case-sensitive names on POSIX, and add real-process regressions for mixed-case PATH/variables and --no-override controls. The isolated native Windows process reproduction has been run; no production usage is claimed. AI assistance: OpenAI Codex.
Activity