Skip to content

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

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

Closed
Xiaokang2022 opened this issue Dec 17, 2024 · 1 comment
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes stdlib Python modules in the Lib dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@Xiaokang2022
Copy link
Contributor

Xiaokang2022 commented Dec 17, 2024

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

@Xiaokang2022 Xiaokang2022 added the type-bug An unexpected behavior, bug, or error label Dec 17, 2024
@picnixz picnixz added stdlib Python modules in the Lib dir 3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes labels Dec 17, 2024
serhiy-storchaka added a commit that referenced this issue Jan 2, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 2, 2025
…bitmap() (pythonGH-128015)

(cherry picked from commit 58e9f95)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jan 2, 2025
…wm_iconbitmap() (pythonGH-128015)

(cherry picked from commit 58e9f95)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka
Copy link
Member

Thank you for your report and PR @Xiaokang2022.

serhiy-storchaka added a commit that referenced this issue Jan 2, 2025
…nbitmap() (GH-128015) (GH-128418)

(cherry picked from commit 58e9f95)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this issue Jan 2, 2025
…nbitmap() (GH-128015) (GH-128420)

(cherry picked from commit 58e9f95)

Co-authored-by: Zhikang Yan <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes stdlib Python modules in the Lib dir topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants