Skip to content

tkinter.Wm.wm_iconbitmap has no effect when passing an empty string to the parameter default #128014

Closed

Description

@Xiaokang2022

Bug report

Bug description:

import tkinter
from tkinter import messagebox

root = tkinter.Tk()
root.update()
root.tk.call("wm", "iconbitmap", root._w, "-default", "")
messagebox.showinfo()
root.mainloop()

Running the code above can get the following effect:

image_1


import tkinter
from tkinter import messagebox

root = tkinter.Tk()
root.update()
root.wm_iconbitmap(default="")  # the different line
messagebox.showinfo()
root.mainloop()

Running the code above can get the following effect:

image_2

However, in fact, these two pieces of code should be equivalent, but due to an inaccurate logical judgment, this problem arises.

This is a very easy bug to fix, and I'll create a PR to fix it later.

The issue may only exist on Windows systems.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    on Dec 17, 2024
  2. added a commit that references this issue on Jan 2, 2025
  3. added a commit that references this issue on Jan 2, 2025
  4. added a commit that references this issue on Jan 2, 2025
  5. serhiy-storchaka commented on Jan 2, 2025

    @serhiy-storchaka
    Member

    Thank you for your report and PR @Xiaokang2022.

  6. added 2 commits that reference this issue on Jan 2, 2025
  7. added a commit that references this issue on Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13only security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions