-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing of encoding to load_dotenv and dotenv_values (Pr/144) #161
Conversation
README.md
Outdated
dev | ||
----- | ||
|
||
- `load_dotenv` and `dotenv_values` now accepts `encoding` paramater (#161) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to add that the default encoding changes from platform-dependent to UTF-8, especially since it might break on some platforms where UTF-8 isn't the default. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use locale.getpreferredencoding()
as default value. This will keep behavior stay same as before, because it's default encoding when we call open
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply pass encoding=None
to let io.open
infer the user’s default environment encoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing encoding=None sounds like the way to go, breaking the existing API doesn't sound like a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the encoding to be platform independent now, it's not a breaking change now. cc: @bbc2
9f4b5ac
to
2ac0325
Compare
Added argument for .env file encoding. Default encoding is None.
closes #144