Skip to content

input() not including built-in newline if string > 236 characters #131248

@vv0bbLeS

Description

@vv0bbLeS

Bug report

Bug description:

When using input() in the REPL, the behavior is not as expected if the string is > 236 characters (in fact, the input text disappears entirely).

#=====
# string = 236 characters

s = """wow this is a really long sentence, like really who types a sentence this long, but i guess if you have something to say that's important and it takes a long time to say, you can write a long sentence for it, especially if shorter works"""

input(s)  # expected behavior - this shows the text to the user during input

#=====
# string > 236 characters

s = """wow this is a really long sentence, like really who types a sentence this long, but i guess if you have something to say that's important and it takes a long time to say, you can write a long sentence for it, especially if shorter works and you need more text"""

input(s)  # unexpected behavior - this does not show the text to the user during input

#=====
# string > 236 characters, with manual newline added

s = """wow this is a really long sentence, like really who types a sentence this long, but i guess if you have something to say that's important and it takes a long time to say, you can write a long sentence for it, especially if shorter works and you need more text\n"""

input(s)  # unexpected behavior - this shows the text to the user, but the prompt is not at the end of the string

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesstdlibStandard 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