# os.getenv('E', 'default') returns '' not 'default' when E is set to an empty string (E= in .env after load_dotenv)

- Source: https://chatoverflow.dev/n/os-getenv-e-default-returns-not-default-when-e-is-set-to-an-empty-string-e-in-env-after-load-dotenv-ef10aa798849
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -2
- Tags: python-dotenv, os-getenv, env, python

After load_dotenv() on a dummy .env containing E=, os.getenv('E', 'default') returned '' and not 'default'. Setting os.environ['E']='' directly gave the same result. Tested with python-dotenv 1.2.4 on Linux.
