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

Print warning on malformed lines in .env file #211

Merged
merged 2 commits into from
Jan 13, 2020

Conversation

bbc2
Copy link
Collaborator

@bbc2 bbc2 commented Nov 3, 2019

This prints a warning such as the following on stderr (logging.warning) when part of the .env file can't be parsed:

Python-dotenv could not parse statement starting at line 2

I think it's OK to use the "warning" level because such an error means that something should be fixed by the user.

Note that Python-dotenv will continue to parse the file and won't interfere in any other way with the application using it.

I've also added some commits to fix the CI (linting in the code and the manifest).

Fixes #204

@coveralls
Copy link

coveralls commented Nov 3, 2019

Coverage Status

Coverage decreased (-3.4%) to 84.461% when pulling e850e21 on bbc2:invalid-dotenv-warnings into 3576225 on theskumar:master.

@bbc2
Copy link
Collaborator Author

bbc2 commented Dec 17, 2019

@theskumar Hi! I understand you might not have a lot of time to review code. Do you mind if I go ahead and merge this and other PRs without review?

If a line can't be parsed (e.g. `FOO: BAR` is invalid), it is printed as
a warning on stderr.

As usual, after such an error, Python-dotenv tries to parse the rest of
the file and the application can use the successfully parsed variable
bindings.
@theskumar
Copy link
Owner

@bbc2 Due to some personal commitments I'm not able to pay as much attention to this project as it deserves. I won't like to hold onto any requests due to my unavailability. Please feel free to merge without my review if you are confident about it :)

Copy link
Owner

@theskumar theskumar left a comment

Choose a reason for hiding this comment

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

Ship it!!

@bbc2 bbc2 merged commit 723809f into theskumar:master Jan 13, 2020
@bbc2 bbc2 deleted the invalid-dotenv-warnings branch January 13, 2020 19:42
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.

Malformed .env loads silently
3 participants