We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
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.
rewrite
if not os.path.isfile(path): with open(path, mode="w", encoding=encoding) as source: source.write("")
python-dotenv/src/dotenv/main.py
Line 134 in 3ffcef6
The text was updated successfully, but these errors were encountered:
Fix set_key creates orphan .env file
8faa34b
Changed: - `set_key` now checks if the `dotenv_path` exists Fix theskumar#480
Successfully merging a pull request may close this issue.
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 usesrewrite
which if path passed is not a file, it creates an empty file.python-dotenv/src/dotenv/main.py
Line 134 in 3ffcef6
The text was updated successfully, but these errors were encountered: