AmbiguousEnvVar when setting default runner.env with both lower and uppercase
还没有人认领这个 Issue。
评估
调研方向
Reproduce the failure using invoke.yml and tasks.py, or the Python configuration shown, then run the @invoke.task function through ctx.run('env && exit 1'). Trace the environment handling involved in RUN_ENV_NO_PROXY and verify that configuring both uppercase and lowercase variants no longer raises AmbiguousEnvVar while preserving the configured values.
由索引模型根据 Issue 内容生成。
描述
Hi,
I think I discovered an issue with the environment system, you can't set default environment variables with both upper and lowercase variants, like for HTTP_PROXY:
import invoke
ns = invoke.Collection()
ns.configure(dict(
run=dict(
echo=True,
env={
**{
env_name: "http://my-proxy/"
for env_name in ("http_proxy", "https_proxy", "HTTP_PROXY", "HTTPS_PROXY")
},
**{
env_name: "localhost" for env_name in ("no_proxy", "NO_PROXY")
}
}
)
))
@invoke.task
def test(ctx):
ctx.run('env && exit 1')
ns.add_task(test, "test")
This is also true with the following:
invoke.yml
run: env: HTTP_PROXY: 1 http_proxy: 1tasks.py
import invoke @invoke.task def test(ctx): ctx.run('env && exit 1')
inv test
[..]
invoke.exceptions.AmbiguousEnvVar: Found >1 source for RUN_ENV_NO_PROXY
I guess only keys with the invoke prefix or only external (not set in config) environment variables should be analyzed? RUN_ENV_ subkeys should be analyzed without case modification?
- 主要语言
- Python
- 星标
- 4.8k
- 派生
- 412
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pyinvoke/invoke 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 64/100
相似的 Issue
-
bug priority:low
难度 2/5 1-3 小时 新手友好度 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
难度 2/5 1-3 小时 新手友好度 86/100
NousResearch/hermes-agent#122386 · 1 条评论 ·
-
ai-generated
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/production-stack#1105 ·
-
难度 2/5 1-3 小时 新手友好度 88/100