Contrib SSH : can't import on Windows due to posix pipe use
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- cli, networking
调研方向
从 contrib/ssh/server.py 开始,检查其管道输入是如何导入和初始化的。让 SSH 服务器选择适合平台的管道输入,使异步 SSHD 设置能够在 Windows 上工作,同时保持 POSIX 行为,然后验证两个导入路径以及 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
- 派生
- 819
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
prompt-toolkit/python-prompt-toolkit 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 95/100
prompt-toolkit/python-prompt-toolkit#2102 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
prompt-toolkit/python-prompt-toolkit#2097 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 92/100
prompt-toolkit/python-prompt-toolkit#2092 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
prompt-toolkit/python-prompt-toolkit#2073 · 2 条评论 ·
维护者通常 4 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
prompt-toolkit/python-prompt-toolkit#1406 ·
维护者通常 4 天内回复
查看 prompt-toolkit/python-prompt-toolkit 的全部 Issue
相似的 Issue
-
repo-audit
难度 2/5 1-3 小时 新手友好度 75/100
scverse/repo-health#20 ·
维护者通常 1 天内回复
-
/context/prime scope override double-prefixes an entity-ref project and drops its scoped memories未关闭
难度 2/5 1-3 小时 新手友好度 85/100
phasespace-labs/palinode#232 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
collective/icalendar#1858 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
langflow-ai/langflow#15496 ·
维护者通常 1 天内回复