Xorg problem while running tkinter program on manjaro (Python)

I faced with problem while running tkinter program on manjaro. Here the minimal reproducable example:

#test.py
from tkinter import *
win=Tk()
lbl=Label(win)
win.mainloop()

After running the next error occurs:

$ python3 test.py 
X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  20 (RenderAddGlyphs)
  Serial number of failed request:  38
  Current serial number in output stream:  47

Running the same code without label creation works fine and shows tkinter window. The same error occurs with creating Button, Entry ets.
While googling I found several similar issues, but I still dont understand, how to fix that.
Any ideas, what can be cause this error?

What is your terminal emulator?
Can you check running it from others?

I use standart KDE terminal (Konsole). The same error occurs in Terminator

What about font?
Does the font you are using support this glyph that you are trying to use?

Sorry, I can’t understand what glyph you are meaning for.
I use Noto Mono 10pt font

It seems like a number of different scenarios all point back to that roughly:


Also maybe check that libxft is installed … and possibly try AUR (en) - libxft-bgra
Though I thought that was more for ‘suckless’ type things needing a patch.

1 Like

Thanks a lot! Due to your answer i have found the solution.

Firstly I have installed libxft.
This post from your second link said that the problem is in the colored-emoji fonts. I remembered, that one time I did steps from some tutorial to enable emoji in terminal. I go to the /etc/fonts/ and found file local.conf with the next content:

<fontconfig>

    <match target="pattern">
        <test qual="any" name="family"><string>monospace</string></test>
        <edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>serif</string></test>
        <edit name="family" mode="append" binding="strong"><string>Noto Color Emoji</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>sans-serif</string></test>
        <edit name="family" mode="append" binding="strong"><string>Noto Color Emoji</string></edit>
    </match>

</fontconfig>

After deleting it and rebooting, tkinter works fine. Also this fixed the problem with font of numbers – with such local.conf they showed as emoji.
For correct emoji settings above post also proposes this tutorial, which works for me.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.