Skip to content

duplicate input() prompts in REPL #149421

@KuRRe8

Description

@KuRRe8

Bug report

Bug description:

In the mainpage of https://www.python.org/, there is an example code block.

# Simple output (with Unicode)
>>> print("Hello, I'm Python!")
Hello, I'm Python!

# Input, assignment
>>> name = input('What is your name?\n')
>>> print(f'Hi, {name}.')
What is your name?
Python
Hi, Python.

when I try it in the embeded python in https://www.python.org/, it behaves strange

Python 3.13.1 (main, Jan 16 2025, 13:50:41) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> name = input('What is your name?\n')
What is your name?
What is your name?
What is your name?
What is your name?
What is your name?
What is your name?
What is your name?
python
>>> 

that is, whenever I press a key it prompts once.

Then I tried it in Win10 + pwsh + Windows Terminal + python3.15.0a7

PS A:\> python3.15t.exe
Python 3.15.0a7 free-threading build (main, Mar 10 2026, 18:28:44) [MSC v.1950 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> name = input('What is your name?\n')
What is your name?
What is your name?
What is your name?
What is your name?
bob
>>> import sys
>>> sys.version
'3.15.0a7 free-threading build (main, Mar 10 2026, 18:28:44) [MSC v.1950 64 bit (AMD64)]'
>>>

I'm not sure if this issue is tracked or fixed since I dont see related results in issue page. I also tried it in Windows10 + WindowsTerminal + WSL2 + Ubuntu 24.04. It performs good either of version 3.12.3 or 3.15.0a8(build from source)

CPython versions tested on:

3.15

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions