-
Notifications
You must be signed in to change notification settings - Fork 415
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
Added better context for can't find config file error message #245
Conversation
https://github.com/theskumar/python-dotenv/pull/245/files#diff-801425242c4901b4508f6da6283b0100R67 We should probably add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snobu Please update the tests to make the test pass on our Travis-CI. Thanks for your contribution. https://travis-ci.org/github/theskumar/python-dotenv/jobs/663461038#L278-L293
I fixed all the tests... eventually :) |
Oh, should we add this other thing or not? |
I think this looks good. I wasn't convinced by this change at first because context is provided by the logging module. When you configure logging in your application, you can choose to show that context. But I suppose that many users don't know that or don't want to do that, so hard-coding that context could be useful. I wouldn't add the "Code execution continues with system environment variables" message because it makes it look like using environment variables is unusual, which it isn't (as I explain in #164). I would even go as far as turning that |
Sorry this took a while and quite a few build cycles as i thought i'm gonna be a smartass and not clone locally but wing it over the browser... and we all know how that ends. Should be fine now, i amended the logging level to |
'File doesn't exist' doesn't really tell the user much, let's add some context.
Thanks for the improvements. I squashed the commits together and slightly simplified the test. There are other things about the output of python-dotenv that can be improved but this is already a good step forward. |
I agree with @bbc2 ! |
@bbc2 Would you mind if I changed the logging level back to """myfile.py"""
import dotenv
dotenv.load_dotenv('/not/a/valid/.env/path', verbose=True) does nothing right now. |
'File doesn't exist' doesn't really tell the user much, let's add some context.
Hi, I just had a case where my app crashed because the |
No description provided.