Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AmbiguousEnvVar when setting default runner.env with both lower and uppercase

オープン
#932 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

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: 1

tasks.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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pyinvoke/invoke のほかの issue

pyinvoke/invoke の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。