Skip to content

Fix default expansion for null-valued variables - #759

Closed
adityajai119 wants to merge 1 commit into
theskumar:mainfrom
adityajai119:fix-dotenv-parsing
Closed

adityajai119 wants to merge 1 commit into
theskumar:mainfrom
adityajai119:fix-dotenv-parsing

Conversation

@adityajai119

Copy link
Copy Markdown

When a key is present with no value (for example a bare \KEY\ line), \dotenv_values\ represents it as \None. \Variable.resolve\ used \env.get(name, default), which returns \None\ for a present-but-null key and then produced an empty string instead of the :-\ default.

This changes
esolve\ to fall back to the default whenever the resolved value is \None, so \�=\ with a bare \�\ line now yields \d. Added a focused unit test in \ ests/test_variables.py.

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