Skip to content

Bug: Python 3.13 REPL on Windows drops first items in print loop when using end=' ' #140961

@Nataliya3112

Description

@Nataliya3112

In Python 3.13.9 on Windows, the REPL intermittently fails to print the first elements of a loop when using print(..., end=' ').

Expected output: 1 2 3 4 5

Actual output: 3 4 5

The issue does not occur in IDLE, only in the terminal REPL.

Steps to Reproduce:
1)Run in Windows terminal:
for i in [1,2,3,4,5]:
print(i, end=' ')

2)Observed output: 3 4 5

Environment: Python: 3.13.9 (tags/v3.13.9:8183fa5, Oct 14 2025, 14:09:13) [MSC v.1944 64 bit (AMD64)]
Platform: win32
OS: Windows-10-10.0.19045-SP0

Installed via: py -3.13 launcher
Behavior NOT observed in Python 3.11 or in IDLE.

Notes

Reproducible consistently

Only affects REPL output

Likely related to stdout buffering / console IO changes in Python 3.13 on Windows

print(i) (with newline) works correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions