Skip to content

set_key creates orphan .env file #480

Open
@TheGeeKing

Description

@TheGeeKing

set_key states "If the .env path given doesn't exist, fails instead of risking creating an orphan .env somewhere in the filesystem".

set_key has no check if the file exists. As it uses rewrite which if path passed is not a file, it creates an empty file.

if not os.path.isfile(path):
        with open(path, mode="w", encoding=encoding) as source:
            source.write("")

if not os.path.isfile(path):

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