Allow overwrite value by None if already defined
维护者通常 12 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start at the load_dotenv entry point and trace how a later file is handled when myVar is absent versus explicitly set to an empty value. Compare the two scenarios in the issue, then verify that loading .envA removes the earlier value and returns None when myVar is not defined there.
由索引模型根据 Issue 内容生成。
描述
I have 2 dotenv files:
Scenario1:
/var/www/flask/.envRoot <---- myVar="foo"
and
/home/userA/.envA <----------- myVar="bar"
load_dotenv(dotenv_path='/var/www/flask/.envRoot',override=True)
os.getenv('myVar') # foo
load_dotenv(dotenv_path='/home/userA/.envA',override=True)
os.getenv('myVar') # bar
Scenario2:
/var/www/flask/.envRoot <---- myVar="foo"
and
/home/userA/.envA <----------- myVar not defined
load_dotenv(dotenv_path='/var/www/flask/.envRoot',override=True)
os.getenv('myVar') # foo
load_dotenv(dotenv_path='/home/userA/.envA',override=True)
os.getenv('myVar') # foo
Scenario1 work as spected, but Scenario2 should return None if do not exist on .envA because i explicitly indicate the file to look at. But this do not happen if the key exist e.g: myVar=, only if not defined.
- 主要语言
- Python
- 星标
- 8.9k
- 派生
- 618
- 平均合并
- 12 天 6 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
theskumar/python-dotenv 的其他 Issue
-
Variable declared without a value suppresses ${VAR:-default} expansion可能已有人在做 @Omarinho12345 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
theskumar/python-dotenv#750 ·
维护者通常 12 天内回复
-
An empty value ignores ${name:-default}可能已有人在做 @SashaMIT 于 41 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
theskumar/python-dotenv#715 ·
维护者通常 12 天内回复
-
set_key and unset_key don't fsync before replacing the .env file可能已有人在做 @Imkkey 于 40 天前认领。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 72/100
theskumar/python-dotenv#713 ·
维护者通常 12 天内回复
-
难度 5/5 一周以上 新手友好度 28/100
theskumar/python-dotenv#693 · 1 条评论 ·
维护者通常 12 天内回复
-
python-dotenv installation without cli masks python-dotenv cli可能已有人在做 @gyanu2507 于 80 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
theskumar/python-dotenv#683 · 4 条评论 ·
维护者通常 12 天内回复
查看 theskumar/python-dotenv 的全部 Issue
相似的 Issue
-
release
难度 2/5 1-3 小时 新手友好度 76/100
MichaelYcJo/SpecSeal#1535 ·
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
valentinfrlch/ha-llmvision#769 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 75/100
daniel-ospina/tortoise#11937 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue help wanted python up-for-grabs
难度 2/5 1-3 小时 新手友好度 82/100
andrewsiah/agentswarm-data-tasks#238 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
cadence-workflow/cadence-ai-samples#175 ·
维护者通常 1 天内回复