Skip to content

Fix caching for empty dotenv files#638

Open
ReinerBRO wants to merge 1 commit intotheskumar:mainfrom
ReinerBRO:fix-empty-dotenv-cache
Open

Fix caching for empty dotenv files#638
ReinerBRO wants to merge 1 commit intotheskumar:mainfrom
ReinerBRO:fix-empty-dotenv-cache

Conversation

@ReinerBRO
Copy link

Cache the parsed dict even when the dotenv file is empty.

DotEnv.dict() previously used a truthiness check for _dict, so an empty file would be reparsed on every call. This change switches to an explicit is not None guard and adds a regression test that verifies empty dotenv contents are parsed only once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant