Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters