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

Contrib SSH : can't import on Windows due to posix pipe use

オープン 初心者向け
#1,154 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
cli, networking

調査の方向性

contrib/ssh/server.py から始め、その pipe 入力がどのように import および初期化されているかを調べます。SSH サーバーがプラットフォームに適した pipe 入力を選択するようにして、POSIX の動作を維持しながら Windows で非同期 SSHD セットアップが機能するようにし、その後、両方の import パスと Windows での初期化を確認します。

索引モデルが issue の本文から書いたものです。

説明

I have set up an async SSHD on my Windows 10 box and I had to patch contrib/ssh/server.py in order to do it. The problem is that we import prompt_toolkit.input.posix_pipe at the top, when we need to be versatile to platform and import prompt_toolkit.input.win32_pipe on Windows platforms instead.

Here's how I'm handling this locally:

--- a/prompt_toolkit/contrib/ssh/server.py      2020-05-29 13:15:17.950284900 -0700
+++ b/prompt_toolkit/contrib/ssh/server.py      2020-05-29 13:27:21.302283000 -0700
@@ -9,7 +9,14 @@

 from prompt_toolkit.application.current import AppSession, create_app_session
 from prompt_toolkit.data_structures import Size
-from prompt_toolkit.input.posix_pipe import PosixPipeInput
+from importlib import import_module
+from prompt_toolkit.utils import is_windows
+if (is_windows()):
+    pipe_module = import_module('prompt_toolkit.input.win32_pipe')
+    pipe_input  = pipe_module.Win32PipeInput
+else:
+    pipe_module = import_module('prompt_toolkit.input.posix_pipe')
+    pipe_input  = pipe_module.PosixPipeInput
 from prompt_toolkit.output.vt100 import Vt100_Output

 __all__ = [
@@ -27,7 +34,7 @@
         # PipInput object, for sending input in the CLI.
         # (This is something that we can use in the prompt_toolkit event loop,
         # but still write date in manually.)
-        self._input = PosixPipeInput()
+        self._input = pipe_input()

         # Output object. Don't render to the real stdout, but write everything
         # in the SSH channel.
主要言語
Python
スター
10.6k
フォーク
834
平均マージ
15時間 43分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

prompt-toolkit/python-prompt-toolkit のほかの issue

prompt-toolkit/python-prompt-toolkit の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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