Skip to content

fail if specified .env file does not exist #294

@rptaylor

Description

@rptaylor

Previously discussed in #199

See theskumar/python-dotenv#297

It looks like now there is https://github.com/theskumar/python-dotenv/pull/388/files which will cause load_dotenv to return false if no vars were read:

import dotenv
a=dotenv.load_dotenv('no.env', verbose=True)
print(a)
False

So for the reasons previously described it would be good to have a way in environs to force a failure if the specified env file does not exist, by e.g. checking the return code from dotenv and raising an exception if it is false.

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