Skip to content

Add argument to choose .env file encoding#144

Closed
earlbread wants to merge 1 commit intotheskumar:masterfrom
earlbread:open-with-utf-8
Closed

Add argument to choose .env file encoding#144
earlbread wants to merge 1 commit intotheskumar:masterfrom
earlbread:open-with-utf-8

Conversation

@earlbread
Copy link
Copy Markdown
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
Copy Markdown

Coverage Status

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

encoding='utf-8'):
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)
Copy link
Copy Markdown

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
Copy Markdown
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