Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

In Python 3.13 REPL, print() adds extra indentation when invoked from a tkinter event handler #135045

Open
Labels
3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibPython modules in the Lib dirtopic-replRelated to the interactive shelltopic-tkintertype-bugAn unexpected behavior, bug, or error
@culler

Description

@culler

Bug report

Bug description:

Here is an interactive python 3.13 session on macOS 15.5 using the python.org distribution:

Python 3.13.3 (v3.13.3:6280bb54784, Apr  8 2025, 10:47:54) [Clang 15.0.0 (clang-1500.3.9.4)] on d\arwinType "help", "copyright", "credits" or "license" for more information.>>> import tkinter>>> interp = tkinter.Tk()>>> f = tkinter.Frame(interp, background='blue', width=30, height=30)>>> f.pack(padx=30, pady=30)>>> def handler(event):...     print("Click")...>>> f.bind('<Button-1>', handler)'4384102400handler'>>> # Now click the mouse on the blue square a few times.>>> Click         Click              Click                   Click                        Click

The words "Click" should not be indented. No spaces are being printed. The REPL behaves as if the text is ended with a newline but not with the implicit carriage return.

I expect the print command to behave the same way as it does here:

>>> for i in range(5): print("Click")... ClickClickClickClickClick

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibPython modules in the Lib dirtopic-replRelated to the interactive shelltopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp