Skip to content

Allow passing of encoding to load_dotenv and dotenv_values (Pr/144)#161

Merged
bbc2 merged 1 commit intomasterfrom
pr/144
Apr 30, 2019
Merged

Allow passing of encoding to load_dotenv and dotenv_values (Pr/144)#161
bbc2 merged 1 commit intomasterfrom
pr/144

Conversation

@theskumar
Copy link
Copy Markdown
Owner

closes #144

@coveralls
Copy link
Copy Markdown

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

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

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

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

6 participants