Skip to content

load_dotenv() returns True even if .env file is not found #321

@scollovati

Description

@scollovati

This behaviour is not ideal since if the configuration file is not found in the filesystem it may be better to return False.
In this way the user can write something like:

if load_dotenv():
    #do stuff
else
    print("No file .env found")

Steps to reproduce

In [1]: import dotenv

In [2]: dotenv.load_dotenv()
Out[2]: True

In [3]: dotenv.find_dotenv()
Out[3]: ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions