Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.13 REPL on Windows Terminal is chopping off the first four characters printed if end parameter is used in print function #128809

Open
journpy opened this issue Jan 14, 2025 · 5 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes OS-windows stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@journpy
Copy link

journpy commented Jan 14, 2025

Bug report

Bug description:

If I use the end parameter in print function, the first four characters (including whitespaces) of the output are chopped off. I have tried using other Python versions (3.10 - 3.12) and everything works well. It is somewhat strange that this happens only on Python 3.13 REPL in Windows Terminal or Command Prompt. Consider the MRE below:

for i in range(10):
   print(i, end='')

prints: 456789. Numbers 0, 1, 2, and 3 are missing.

Also

print('first', end='|')

prints t| instead of first|. Characters 'f', 'i', 'r', 's' are missing.

My specific version is Python 3.13.0. I'd like to know if this is happening because I'm on a Windows machine or is it an issue with Python 3.13.0? Thanks.

CPython versions tested on:

3.10, 3.11, 3.12, 3.13

Operating systems tested on:

Windows

@journpy journpy added the type-bug An unexpected behavior, bug, or error label Jan 14, 2025
@eendebakpt eendebakpt added the topic-repl Related to the interactive shell label Jan 14, 2025
@picnixz picnixz added stdlib Python modules in the Lib dir 3.13 bugs and security fixes 3.14 new features, bugs and security fixes pending The issue will be closed if no feedback is provided labels Jan 14, 2025
@picnixz
Copy link
Member

picnixz commented Jan 14, 2025

Can you test with the latest Python 3.13 release? we're currently at 3.13.1. I cannot reproduce this on Linux and on 3.14.

@eendebakpt
Copy link
Contributor

eendebakpt commented Jan 14, 2025

I can confirm this issue on latest main (Windows). It might be the first three characters are printed, but then overwritten by the prompt >>>

@picnixz picnixz added OS-windows and removed pending The issue will be closed if no feedback is provided labels Jan 14, 2025
@picnixz
Copy link
Member

picnixz commented Jan 14, 2025

cc @pablogsal

@pablogsal
Copy link
Member

Unfortunately I don't have a windows machine at the moment 😕. @DinoV @zooba @ambv can you take a look if you have some free cycles?

@rruuaanng
Copy link
Contributor

The strange thing is that it seems to be related to outputting end.
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes OS-windows stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants