Credentials input not working with contex.run from within a Devcontainer
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start by running the provided reproduction script inside a VSCode devcontainer, then trace Context.run with in_stream=True and pty=True/False, including the interaction with Python's input() and getpass(). Done means username and password entry work correctly without the first character being swallowed or the password prompt becoming unresponsive.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
While I found several different issues where something related to stdin did or does not work - this one does not seem to be covered, yet:
What happens:
Entering user name/pw from stdin to programm started with c.run does not work. What (mostly) happens:
- First character gets swallowed somehow. Have to press the first character twice. Found some issues about that one. And: Looks ike
in_stream=Falsemakes the first character appear on the first key press. - PW entry not working: When running inside the devcontainer, after pressing enter to confirm the user name, the password prompt is missing, and nothing happens when I press any key.
pty=True/Falsedoes not seem to have an effectin_stream=Falsewill avoid the 'first-character-gets-swallowed` problem, but still not fix the passwort-entry-problem
You should be able to use the following script to reproduce the issue - when executed from within a devcontainer in VSCode:
import shlex
import sys
import textwrap
from invoke import Context
INNER_SCRIPT = textwrap.dedent(
"""
from getpass import getpass
print('=== Please enter your USERNAME ===', flush=True)
username = input()
print('=== Please enter your PASSWORD ===', flush=True)
password = getpass('')
print(f'You entered username: {username}')
print(f'You entered password: {password}')
"""
).strip()
print(">>> running via invoke Context.run(pty=True)")
cmd = f"{shlex.quote(sys.executable)} -c {shlex.quote(INNER_SCRIPT)}"
Context().run(cmd, in_stream=True)
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pyinvoke/invoke
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
sdist is missing `pytest.ini` Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Todos los issues de pyinvoke/invoke
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100