AmbiguousEnvVar when setting default runner.env with both lower and uppercase
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Python
- Star
- 4.8k
- Fork
- 412
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyinvoke/invoke
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Tất cả issue của pyinvoke/invoke
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·