python / python/cpython

New REPL repeats prompt with newline after each key

未关闭
#127,068 7 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

3.13 3.14 3.15 stdlib topic-repl type-bug
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Bug report

Bug description:
# Add a code block here, if required
>>> input("word\n")
word
word
word
word
word
word
hello
'hello'

When using Python 3.13.0 with the interpreter on Windows Terminal, I tried to write a simple input message to the user with a line break. It resulted in a repetition of the message for every character I wrote and every pressing of a key on the keyboard (including backspace). It does not affect the usability of the input command, but it is annoying.
The bug reproduced on Windows 10 and Windows 11. It does not appear to happen not on the IDLE nor on VSCode.
Windows 11 24H2
Windows 10 22H2

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs
  • gh-139465
  • gh-142817

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

在 Windows Terminal 的 Python 3.13 REPL 中使用 input("word\n") 重现该问题,包括输入和退格操作。在进一步调查之前,先查看关联的 PR gh-139465 和 gh-142817;完成的标准是,在报告的 Windows 版本上编辑输入时,提示符或换行符不再在每次按键后重复。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
cli, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。