Skip to content
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

Merged
merged 1 commit into from
Apr 30, 2019

Conversation

theskumar
Copy link
Owner

closes #144

@coveralls
Copy link

coveralls commented Jan 2, 2019

Coverage Status

Coverage increased (+0.04%) to 87.838% when pulling d4d5dc1 on pr/144 into 2767b35 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 88.542% when pulling e9c1954 on pr/144 into 98e4eee on master.

README.md Outdated
dev
-----

- `load_dotenv` and `dotenv_values` now accepts `encoding` paramater (#161)
Copy link
Collaborator

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?

Copy link

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.

Copy link

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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

Added argument for .env file encoding. Default encoding is None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants