unstale

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 init

@unstale/cli on npm

python-dotenv 118 changes

Breaking changes 3

  • 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 notessecurity advisory

  • Drops support for Python 3.7 and adds Python 3.12-dev.

    1.0.0release notes

New APIs and options 1

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 2

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

    1.2.2release notes

  • Supports reading .env files from FIFOs on Unix.

    1.2.1release notes

Fixes and other changes 11

  • 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

  • Handles situations where the current working directory does not exist.

    1.0.0release notes