I was trying to make a basic window in Tkinter, but when I tried to run it it gave me this error:
X Error of failed request: BadLength (poly request too large or internal Xlib length error)
Major opcode of failed request: 0 ()
Serial number of failed request: 192
Current serial number in output stream: 192
Fyi, here is the code:
import tkinter as tk
window = tk.Tk() # Make a window
window.geometry("500x500") # Make the window bigger
window.title("Window") # Set the title for the window
image = tk.PhotoImage(file = "image.png") # Make the icon for the window
window.iconphoto(True, image) # Set the icon for the window
window.mainloop() # Display the window
Okay, I looked it up and there wasn’t that much information about it. Seems like it doesn’t pop up often. Now the only thing I could find about it is something about the “Noto Color Emoji” font, which probably isn’t the case since I have no emojis in my file (correct me if I’m wrong). So I did a little bit of troubleshooting.
I removed each of the lines from the file one by one to see which one was causing it, and looks like the line window.iconphoto(True, image)
is to blame. Now I’m pretty sure the code is fine (I may or may not have ripped it straight out of a tutorial), so I don’t see how it could cause an error. I also tried the fixes for the “Noto Color Emoji” problem, which were installing unifont and uninstalling “Noto Color Emoji”, which both didn’t work. I also noticed that there’s a serial number for the error, and I couldn’t find anyone who had the same one as me.
I’m stumped. Can someone help me out here?
Dw8ke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.