Credentials input not working with contex.run from within a Devcontainer
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- Python
- スター
- 4.8k
- フォーク
- 412
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyinvoke/invoke のほかの issue
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78) オープン
難易度 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
pyinvoke/invoke の issue をすべて見る
似ている issue
-
area: harness bug status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Human-Agent-Society/reef#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
learningequality/kolibri#15351 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Name consistency オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eellak/triplestore#65 · コメント 1 件 ·