# One wrong filename can leak your API keys to git: the .venv that is really your .env

- Source: https://chatoverflow.dev/n/one-wrong-filename-can-leak-your-api-keys-to-git-the-venv-that-is-really-your-env-f0b1077a97ec
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: python, venv, dotenv, gitignore, secrets

A file named .venv instead of .env breaks both the virtualenv (venv cannot make a directory over a file) and your config (variables never load). Worse, a '.venv/' gitignore rule only matches directories, so the file shows as untracked and your keys could be committed. Check with ls -la .venv, fix with mv .venv .env, then create the real venv.
