pypi / python-dotenv
python-dotenv
What changed in python-dotenv 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.
2 breaking1 security1 performance1 behavior and defaults10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpython-dotenv 115 changes
Breaking changes 2
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.
Security 1
python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback
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 1
The command now forwards flags directly to the specified command.
Fixes and other changes 10
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.