unstale

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 init

@unstale/cli 0.2.1 on npm

python-dotenv 115 changes

Breaking changes 2

  • The CLI set and unset commands no longer follow symlinks in some situations.

    1.2.2release notes

  • set_key and unset_key no longer follow symlinks in some situations; use follow_symlinks=True to restore that behavior in all cases.

    1.2.2release notes

Security 1

  • python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback

    1.2.2security advisory

Performance 1

  • Caches the parsed result for empty .env files so repeated dotenv_values/load_dotenv calls no longer re-read the file.

    1.2.3release notes

Behavior and default changes 1

  • The command now forwards flags directly to the specified command.

    1.2.2release notes

Fixes and other changes 10

  • The command no longer exits with code 1 for empty string values such as KEY=.

    1.2.4release notes

  • 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.

    1.2.4release notes

  • An unquoted empty value followed by an inline comment is parsed as an empty string instead of the comment text.

    1.2.4release notes

  • Prints a friendly error instead of a traceback when no command is given.

    1.2.3release notes

  • A leading UTF-8 BOM is stripped from .env file contents so the first variable is no longer silently lost.

    1.2.3release notes

  • 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.

    1.2.3release notes

  • set_key, unset_key, and CLI set and unset now preserve the original file mode; newly created or non-regular files use mode 0o600.

    1.2.2release notes

  • PyPy support is updated to version 3.11.

    1.2.2release notes

  • Python 3.14, including the free-threaded build, is supported.

    1.2.2release notes

  • Python 3.9 is supported.

    1.2.2release notes