Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#932 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
Python
Estrellas
4.8k
Forks
412
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyinvoke/invoke

Todos los issues de pyinvoke/invoke

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.