Bug 2116804

Summary: SettingsWidgets.py tracebacks: AttributeError: 'gi.repository.Gtk' object has no attribute 'FontChooserLevel'
Product: [Fedora] Fedora EPEL Reporter: Pavol Babinčák <pbabinca>
Component: python-xappAssignee: Wolfgang Ulbrich <raveit65.sun>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel8CC: leigh123linux, raveit65.sun, riehecky
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-xapp-2.2.2-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-20 00:40:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavol Babinčák 2022-08-09 10:37:33 UTC
Description of problem:
I have a system based on RHEL 8 + EPEL + couple of other repositories including https://copr.fedorainfracloud.org/coprs/stenstorp/cinnamon/ . After python3-xapp appeared in EPEL 8, Cinnamon settings no longer open. Here, I'll show minimal example without Cinnamon.

Version-Release number of selected component (if applicable):
python3-xapp-2.2.2-1.el8

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL 8
2. Add EPEL repository https://docs.fedoraproject.org/en-US/epel/
3. Run python3 /usr/lib/python3.6/site-packages/xapp/SettingsWidgets.py

Actual results:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/xapp/SettingsWidgets.py", line 428, in <module>
    class FontButton(SettingsWidget):
  File "/usr/lib/python3.6/site-packages/xapp/SettingsWidgets.py", line 432, in FontButton
    def __init__(self, label, level=(Gtk.FontChooserLevel.STYLE | Gtk.FontChooserLevel.SIZE), size_group=None, dep_key=None, tooltip=""):
  File "/usr/lib64/python3.6/site-packages/gi/overrides/__init__.py", line 39, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib64/python3.6/site-packages/gi/module.py", line 141, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gtk' object has no attribute 'FontChooserLevel'


Expected results:
No error should be printed.

Additional info:
Copr repo provides same package in version 2.0.2-2.el8 that works with Cinnamon itself and also reproducer above doesn't fail.

Cinnamon doesn't start SettingsWidgets directly, but imports it when binary /usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py is started.

Alternative reproducer - instead of running script one could run following python code:

$ python3
>>> import math
>>> import gi
>>> gi.require_version('Gtk', '3.0')
>>> gi.require_version('XApp', '1.0')
>>> from gi.repository import Gio, Gtk, GObject, Gdk, GLib, XApp
>>> Gtk.FontChooserLevel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/gi/overrides/__init__.py", line 39, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib64/python3.6/site-packages/gi/module.py", line 141, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gtk' object has no attribute 'FontChooserLevel'
>>>

Comment 1 Pat Riehecky 2022-08-09 15:57:50 UTC
I'm showing:
  python3-xapp   noarch 2.0.2-2.el8  copr:copr.fedorainfracloud.org:stenstorp:cinnamon
  python3-xapp   noarch 2.2.2-1.el8  epel

It looks like python3-xapp-2.2.2-1.el8 was built by raveit65

Comment 2 Pavol Babinčák 2022-08-10 09:09:21 UTC
Yes, it seems so. And according to Bodhi https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-475c131c4b it seems to be there to introduce lightdm-settings in EPEL 8.

Comment 3 Pavol Babinčák 2022-08-15 10:47:25 UTC
Wolfgang, would this be something that you could look into?

Comment 4 Wolfgang Ulbrich 2022-08-16 17:15:09 UTC
python3-xapp-2.2.2-1 works fine with current cinnamon-settings-daemon-5.2.0-3.fc36 in stable f36.
So i am thinking more that cinnamon needs to be updated.
And i know from stenstorp/mate/ repository that this guy did downgrade packages with a epoch instead of fixing the real issue.
And this way i can't go for official fedora building.
So what cinnamon version are you using?

Comment 5 Wolfgang Ulbrich 2022-08-16 17:18:15 UTC
Btw. i added MATE desktop to epel8 and i don't have any clue about cinnamons packaging situation.

Comment 6 Wolfgang Ulbrich 2022-08-16 17:27:34 UTC
I suggest to open a issue at upstream, only those guys know why their software isn't compatible to their own apps.
https://github.com/linuxmint/python3-xapp

Comment 7 Wolfgang Ulbrich 2022-08-16 17:29:31 UTC
I guess the issue was introduced here https://github.com/linuxmint/python3-xapp/commit/cf83fa5a5ebb17f6f6e7c81b1ae77b915f241b5a

Comment 8 Wolfgang Ulbrich 2022-08-16 17:36:12 UTC
Btw. can you build and test python3-xapp-2.2.2 with that commit reverted?
Commit description looks like a hack which may not needed for epel8 with older gtk version.
I am happy to revert that commit in rpm when it does fix your issue.

Comment 9 leigh scott 2022-08-16 18:52:47 UTC
(In reply to Pavol Babinčák from comment #0)

> $ python3
> >>> import math
> >>> import gi
> >>> gi.require_version('Gtk', '3.0')
> >>> gi.require_version('XApp', '1.0')
> >>> from gi.repository import Gio, Gtk, GObject, Gdk, GLib, XApp
> >>> Gtk.FontChooserLevel
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib64/python3.6/site-packages/gi/overrides/__init__.py", line
> 39, in __getattr__
>     return getattr(self._introspection_module, name)
>   File "/usr/lib64/python3.6/site-packages/gi/module.py", line 141, in
> __getattr__
>     self.__name__, name))
> AttributeError: 'gi.repository.Gtk' object has no attribute
> 'FontChooserLevel'
> >>>

epel8 gtk3 is too old or broken.

Comment 10 leigh scott 2022-08-16 18:56:49 UTC
Available since:	3.24.1

See https://docs.gtk.org/gtk3/property.FontChooser.level.html

Comment 11 Wolfgang Ulbrich 2022-08-17 17:04:29 UTC
Please try out this scratch build, this should fix the issue.
https://koji.fedoraproject.org/koji/taskinfo?taskID=90931049
and give feedback here. Than i will push changes to epel repo.

Comment 12 Pavol Babinčák 2022-08-18 10:11:44 UTC
(In reply to Wolfgang Ulbrich from comment #11)
> Please try out this scratch build, this should fix the issue.
> https://koji.fedoraproject.org/koji/taskinfo?taskID=90931049
> and give feedback here. Than i will push changes to epel repo.

I have installed this scratch build and I tested:

1) Run of "python3 /usr/lib/python3.6/site-packages/xapp/SettingsWidgets.py" doesn't produce any error.
2) Run of "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py" opens Cinnamon's System Settings.

So in total this looks good to me. 👍

---

(In reply to Wolfgang Ulbrich from comment #4)
> python3-xapp-2.2.2-1 works fine with current
> cinnamon-settings-daemon-5.2.0-3.fc36 in stable f36.
> So i am thinking more that cinnamon needs to be updated.

As Leigh wrote, RHEL has too old gtk3 for newer versions of Cinnamon. I have gtk3-3.22.30-10.el8.x86_64 installed.

> And i know from stenstorp/mate/ repository that this guy did downgrade
> packages with a epoch instead of fixing the real issue.
> And this way i can't go for official fedora building.
> So what cinnamon version are you using?

cinnamon-4.6.7-1.el8.x86_64 from Vendor: Fedora Copr - user stenstorp.

Comment 13 Fedora Update System 2022-08-18 20:01:32 UTC
FEDORA-EPEL-2022-d6609a7659 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-d6609a7659

Comment 14 Wolfgang Ulbrich 2022-08-18 20:02:12 UTC
Please leave karma.

Comment 15 Fedora Update System 2022-08-19 01:59:26 UTC
FEDORA-EPEL-2022-d6609a7659 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-d6609a7659

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2022-08-20 00:40:52 UTC
FEDORA-EPEL-2022-d6609a7659 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.