Opened 4 years ago

Closed 4 years ago

#3328 closed bug (Fixed)

GLib.io_add_watch error

Reported by: Lord-Kamina Owned by:
Priority: minor Milestone: not applicable
Component: Packaging Version: 2.0.3
Keywords: twisted gtk crash TypeError glib2 gobject gio gir Cc:

Description

I'm trying to make a viable mac bundle (and hopefully once that is done, a script to reliably produce them)

So far, I'm stuck and Deluge won't run; I'm getting the following error,

Traceback (most recent call last):
  File "/opt/deluge/packaging/osx/app/Deluge.app/Contents/MacOS/Deluge-bin", line 11, in <module>
    load_entry_point('deluge==2.0.3', 'gui_scripts', 'deluge-gtk')()
  File "/opt/deluge/packaging/osx/app/Deluge.app/Contents/Resources/lib/python3.6/deluge-2.0.3-py3.6.egg/deluge/ui/gtk3/__init__.py", line 63, in start
    Gtk().start()
  File "/opt/deluge/packaging/osx/app/Deluge.app/Contents/Resources/lib/python3.6/deluge-2.0.3-py3.6.egg/deluge/ui/gtk3/__init__.py", line 43, in start
    from .gtkui import GtkUI
  File "/opt/deluge/packaging/osx/app/Deluge.app/Contents/Resources/lib/python3.6/deluge-2.0.3-py3.6.egg/deluge/ui/gtk3/gtkui.py", line 33, in <module>
    reactor = gtk3reactor.install()
  File "twisted/internet/gtk3reactor.pyc", line 71, in install
  File "twisted/internet/gtk3reactor.pyc", line 50, in __init__
  File "twisted/internet/gireactor.pyc", line 117, in __init__
  File "twisted/internet/_glibbase.pyc", line 109, in __init__
  File "twisted/internet/base.pyc", line 512, in __init__
  File "twisted/internet/posixbase.pyc", line 286, in installWaker
  File "twisted/internet/_glibbase.pyc", line 197, in addReader
  File "twisted/internet/_glibbase.pyc", line 188, in _add
  File "twisted/internet/_glibbase.pyc", line 162, in input_add
TypeError: GLib.io_add_watch() got multiple values for keyword argument 'priority'

Technically I guess it might actually Twisted's fault but there is one thing that bugs me... if I run Deluge in ubuntu, I don't have that issue... I've even tried matching the versions of twisted and other dependencies on my environment (and subsequently bundle) to what is included in the official canonical repos but I still get that error.

Over at twisted, _glybbase.py hasn't been touched in three years. So, there must be _something_ deluge does different in linux and mac that works fine on one and triggers that error on the other? Maybe it's a quartz vs x11 issue? I don't know.

P.S. I've also tried with both Python 3.7 and 3.6.

Change History (8)

comment:1 Changed 4 years ago by Cas

  • Component changed from Unknown to Packaging
  • Milestone changed from needs verified to not applicable

That is quite odd, looking at the source code for pygobject, it should handle that usage by twisted: https://gitlab.gnome.org/GNOME/pygobject/blob/3.34.0/gi/overrides/GLib.py#L612

What version of pygobject are you using?

comment:2 Changed 4 years ago by Lord-Kamina

I have tried both 3.34 and 3.28; coupled with Twisted 19.10, 19.7, 18.9 and 17.5 So far all have produced the same result. I have detected a potential issue with gtk-osx-application(macports-side) that I'm currently working on solving (no idea if it could be related though)

I plan eventually to put the whole thing through a debugger once I'm done with that kn case I can get some insight but I've never used pdb so 🤷🏼‍♂️

comment:3 Changed 4 years ago by Cas

Can you test from a Python prompt that the function call will accept the old-style arguments?

e.g.

from gi import version_info
version_info
from gi.repository import GLib
GLib.io_add_watch(1,GLib.IOCondition(1),print,priority=1)

I get:

>>> version_info
(3, 34, 0)
>>> GLib.io_add_watch(1,GLib.IOCondition(1),print,priority=1)
1

I don't think a debugger would provide any more information so perhaps if you are still facing this issue ask the PyGobject? or Twisted devs for their thoughts.

For reference there is an old Twisted ticket about this: https://twistedmatrix.com/trac/ticket/6369 but since pygobject shims this function it was never fixed in twisted.

comment:4 Changed 4 years ago by Lord-Kamina

Will try it when I got some time (tonight or tomorrow). I also opened a new ticket over at twisted and referenced that and another one but so far there's no answer.

The reason I think a debugger might help is... I tried using the same versions as packaged in Ubuntu (where deluge works) and ran into the error. So, I figure there might be a branch somewhere in the code that triggers the error in my version and not that one (or apparently, homebrew's either)

comment:5 follow-up: Changed 4 years ago by Lord-Kamina

So... I just tried it, definitely appears to be a packaging issue; using python3 from the macports prefix works fine; but using the python executable insie my bundle throws the error.

comment:6 in reply to: ↑ 5 Changed 4 years ago by Lord-Kamina

Replying to Lord-Kamina:

So... I just tried it, definitely appears to be a packaging issue; using python3 from the macports prefix works fine; but using the python executable insie my bundle throws the error.

And, adding

packages = gi

to setup.cfg seems to have fixed that; I'm now getting a different error:

(Deluge-bin:62329): Gtk-WARNING **: 15:58:51.386: Locale not supported by C library.
	Using the fallback 'C' locale.
Trace/BPT trap: 5

Which seems pretty generic but I expect the solution will most likely be the same: Some nondescript module dependence py2app failed to pick-up.

Edit: The warning at least is most likely related to my nonstandard locale (en_CL; English language in Chile) but the crash probably has to do with .mo files being missing from my package. The deluge in my package is the egg created by bdist_egg; any idea why would translations be missing from it?

Last edited 4 years ago by Lord-Kamina (previous) (diff)

comment:7 Changed 4 years ago by Lord-Kamina

Close this please, it was indeed a packaging issue.

comment:8 Changed 4 years ago by Cas

  • Resolution set to Fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.