Problem with twisted gtk3reactor and pygtkcompat on 13.1

I am trying to work with an application that uses gtk3reactor from python-twisted. When run, it reports:

Traceback (most recent call last):  File "./postr", line 24, in <module>
    from twisted.internet import gtk3reactor
  File "/usr/lib64/python2.7/site-packages/twisted/internet/gtk3reactor.py", line 26, in <module>
    from twisted.internet import gireactor
  File "/usr/lib64/python2.7/site-packages/twisted/internet/gireactor.py", line 84, in <module>
    from gi import pygtkcompat
  File "/usr/lib64/python2.7/site-packages/gi/pygtkcompat.py", line 10, in <module>
ImportError: No module named pygtkcompat

There is no file /usr/lib64/python2.7/site-packages/gi/pygtkcompat.py, but there are pygtkcompat.pyc and .pyo, and they come from python-gobject-3.10.2. It appears to be the only missing .py file in that package.

I have read that twisted should be importing pygtkcompat directly instead of via gi.pygtkcompat, but there is no plain pygtkcompat import on my system, nor have I found a package that provides it. Looking at my Ubuntu systems, there is a separate pygtkcompat directory that part of the python-gi (gobject introspection) package, and the gtk3reactor import works.

Is this a bug in the python-gobject package, or some other problem?

Hi
If you look at the package on OBS;
https://build.opensuse.org/package/view_file/devel:languages:python3/python3-gobject/python-gobject.spec?expand=1


# Drop pygtkcompat layer.it's useless and we lack other stuff for it to work
rm %{buildroot}%{local_py_sitedir}/gi/pygtkcompat.py
rm -r %{buildroot}%{local_py_sitedir}/pygtkcompat/
rm examples/Makefile*

So, not a bug…

So there’s no way to use gtk3reactor in twisted? This is a stock install of python-Twisted-13.2.0-2.4.1.x86_64.

Hi
Perhaps send an email to one of the maintainer(s) to find out why it (and other bits) aren’t working?
https://build.opensuse.org/package/users/devel:languages:python3/python3-gobject

Else you could branch on OBS, rem out the deletion of the files and install your own version?