pypi / python-dotenv
python-dotenv
What changed in python-dotenv 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
3 breaking1 new APIs and options1 performance2 behavior and defaults11 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpython-dotenv 118 changes
Breaking changes 3
The CLI set and unset commands no longer follow symlinks in some situations.
set_key and unset_key no longer follow symlinks in some situations; use follow_symlinks=True to restore that behavior in all cases.
Drops support for Python 3.7 and adds Python 3.12-dev.
New APIs and options 1
Set this flag to disable load_dotenv.
Performance 1
Caches the parsed result for empty .env files so repeated dotenv_values/load_dotenv calls no longer re-read the file.
Behavior and default changes 2
The command now forwards flags directly to the specified command.
Supports reading .env files from FIFOs on Unix.
Fixes and other changes 11
The command no longer exits with code 1 for empty string values such as KEY=.
With --no-override, variable references use the same precedence as load_dotenv(override=False), using existing environment values instead of values from the .env file.
An unquoted empty value followed by an inline comment is parsed as an empty string instead of the comment text.
Prints a friendly error instead of a traceback when no command is given.
A leading UTF-8 BOM is stripped from .env file contents so the first variable is no longer silently lost.
set_key escapes backslashes so values containing them survive a write/read round-trip; quoted values ending in an escaped backslash are no longer mis-parsed.
set_key, unset_key, and CLI set and unset now preserve the original file mode; newly created or non-regular files use mode 0o600.
PyPy support is updated to version 3.11.
Python 3.14, including the free-threaded build, is supported.
Python 3.9 is supported.
Handles situations where the current working directory does not exist.