You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default value for the `encoding` paramter of `load_dotenv` and
`dotenv_values` is now `"utf-8"` instead of `None` (which selected the
encoding based on the user's locale). It is passed directly to
`io.open`.
The rationale for this change is that the encoding of a project file
like `.env` should not depend on the user's locale by default. UTF-8
makes sense as the default encoding since it is also used for Python
source files. The main drawback is that it departs from `open`'s
default value of `None` for the `encoding` parameter.
The default value of `None` was a source of confusion for some users.
The Flask and Docker Compose projects already use `encoding="utf-8"` to
enforce the use of UTF-8 and avoid that sort of confusion.
This is a breaking change but only for users with a non-UTF-8 locale and
non-UTF-8 characters in their .env files.
0 commit comments