Skip to content

read_envfile() recurses up the dir tree if path given, but file not found #33

@arteme

Description

@arteme

When using read_envfile with path defined, the function still recurses up the directory tree if the given path is not found.

Consider the following code:

import envparse
envparse.env.read_envfile('myenv.conf')

The app runs from /home/test/code, which doesn't have myenv.conf file. The following debug log:

DEBUG:envfile not found at myenv.conf, looking in parent dir.
DEBUG:envfile not found at /home/test/myenv.conf, looking in parent dir.
DEBUG:envfile not found at /home/myenv.conf, looking in parent dir.
DEBUG:envfile not found at /myenv.conf, looking in parent dir.
UserWarning: Could not any envfile.

This is contrary to the documentation of the function. The function should not recurse if path is given, but file missing, or if it does this needs to be documented.

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