-
Notifications
You must be signed in to change notification settings - Fork 489
Closed
Description
For .env, we use the following pattern:
export KEY="value" # commentActual behavior after we parse such file:
>>> os.getenv('KEY')
'"value" # comment'Expected behavior:
>>> os.getenv('KEY')
'value'The tricky part here is that # can be contained within the quoted value (e.g. KEY="#"), so we can't ignore everything after the #.
What is worse, bash requires # to be at the beginning of the token, so something like this is valid:
bash$ KEY=#value
bash$ echo $KEY
#value
Ruby dotenv works fine with trailing comments, but it uses a complicated regular expression to do that.
lafrech
Metadata
Metadata
Assignees
Labels
No labels