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

Add argument to choose .env file encoding #144

Closed
wants to merge 1 commit into from

Conversation

earlbread
Copy link
Contributor

Added argument for .env file encoding. Default encoding is UTF-8.

This resolves #74, #121.

Added argument for .env file encoding. Default encoding is UTF-8.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 92.62% when pulling 40a76e9 on earlbread:open-with-utf-8 into 40ed1b1 on theskumar:master.

f = dotenv_path or stream or find_dotenv()
return DotEnv(f, verbose=verbose).set_as_environment_variables(override=override)
return DotEnv(f, verbose=verbose, encoding=encoding).set_as_environment_variables(override=override)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered just capturing the additional keyword arguments and passing them to the DotEnv constructor? That way you don't have to hard-code a default encoding in 3 different places.

@theskumar
Copy link
Owner

Superseded by #161

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.

UnicodeDecodeError occurs when a locale is not set.
4 participants