From ionic@ionic.de  Thu Feb  4 17:49:33 2016
Received: (at 989) by bugs.x2go.org; 4 Feb 2016 16:49:35 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-2.0 required=3.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham
	version=3.3.2
Received: from localhost (localhost [127.0.0.1])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 74AAC5DA90
	for <989@bugs.x2go.org>; Thu,  4 Feb 2016 17:49:33 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at ymir.das-netzwerkteam.de
Received: from ymir.das-netzwerkteam.de ([127.0.0.1])
	by localhost (ymir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id OvI9U9aRhwap for <989@bugs.x2go.org>;
	Thu,  4 Feb 2016 17:49:33 +0100 (CET)
Received: from Root24.de (powered.by.root24.eu [5.135.3.88])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 1323C5DA86
	for <989@bugs.x2go.org>; Thu,  4 Feb 2016 17:49:32 +0100 (CET)
Received: from nopileos.local (home.ionic.de [217.92.117.31])
	by mail.ionic.de (Postfix) with ESMTPSA id 4D40B4F00B28;
	Thu,  4 Feb 2016 17:49:32 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ionic.de; s=default;
	t=1454604572; bh=PQM8NCu5AWKDsHIjsbNGwvrDOqXcpiJCwUBPOHMIrAs=;
	h=Subject:To:References:From:Date:In-Reply-To:From;
	b=hrPpoifyD60Y2YQ4fk1uCyqq195D+azUCYSaibK3D5yLZ8Nm3WcSgEhGVfXhWeOZ7
	 NEXawGXmwso4alsmzh4Fg4zhPuV+R+dujfTocmHOpQjtWBySUbeSi7axL9bJAjKKLq
	 c0rrWvklVVzybjpqkyPPm8HJxSCxE/FEyun73hCM=
Subject: Re: [X2Go-Dev] Bug#989: pyhoca-gui fails to fall back to Gtk-2.0
 notifications (pynotify)
To: =?UTF-8?Q?Ond=c5=99ej_Grover?= <ondrej.grover@gmail.com>,
 989@bugs.x2go.org
References: <CAOyjJOKY4VpqcqKJ2St58tepAgKipgdc=TeGJtgsFpZf5qccdA@mail.gmail.com>
From: Mihai Moldovan <ionic@ionic.de>
X-Enigmail-Draft-Status: N1110
Message-ID: <56B38113.70103@ionic.de>
Date: Thu, 4 Feb 2016 17:49:23 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0)
 Gecko/20100101 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <CAOyjJOKY4VpqcqKJ2St58tepAgKipgdc=TeGJtgsFpZf5qccdA@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="HWIO8fHaICp2uIixNxXDqP4bqVfDHt94S"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--HWIO8fHaICp2uIixNxXDqP4bqVfDHt94S
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 31.01.2016 09:04 AM, Ond=C5=99ej Grover wrote:
> I believe commit e44e848415eff3e4dab69e990adfc447e79143f8 which introdu=
ced GTK3
> notification support broke GTK2 notification support fallback. The prob=
lem was
> not present in 0.5.0.4
>=20
> I believe the problem lies in this import construct in
> pyhoca/wxgui/notify.py which will fail the same way even when put alone=
 in a file
>=20
> try:
>     from gi.repository import Notify as _Notify
> except ImportError:
>     import pynotify as _Notify
>=20
> I think the problem is that even if the GTK3 Notify module is not avail=
able,
> many GTK3 libraries get loaded and then the pynotify import fails with =

>=20
> ImportError: could not import gobject (could not find _PyGObject_API ob=
ject)
>=20
> This is the same exception I see when running pyhoca-gui.
>=20
> I think some more sophisticated GTK version selection mechanism is need=
ed, one
> that would not start loading conflicting libraries.

Thanks for the report. I think your analysis is spot-on.

It looks like a lot of modules from gobject-introspection are loaded, unt=
il it
hits an error importing the Notify module.

Then, importing pynotify fails, because the old, static python-gobject mo=
dule
that pynotify depends on conflicts with the new python-gi
(gobject-introspection) modules.


> As a workaround for now I just removed that GTK3 import on my system.

But it's just that, a workaround.

I've been looking around for a way to actually rollback a failing module =
import
and came up with zit.

The only "actual" solution I currently see is removing pynotify support
completely, because the gobjects interface is deprecated anyway. However,=

that'll break notification support on older systems not having GI/GTK3.

Not that I'd like it, of course. A working fallback would have been great=
=2E



Mihai


--HWIO8fHaICp2uIixNxXDqP4bqVfDHt94S
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCgAGBQJWs4EcAAoJEB/WLtluJTqHmkIQAIhJSM/rGdcZo6HbJFXMu00k
V8SD8iNaUig6TsgD5qxaHuRL9/J8fE/7ET3PPnBdRVGIkYxnaOp4aUwJWCkUrchX
XdNJjHchCE91g/dSATsN56FsOaueq8QnWWw0UMLK7xdaSNsEZEGGuerZBR18y25R
9jHJNMsjqFSbHIKzrKygDTPZMM48eV3Y1rv+X766SmWHoepSlcXUj/4wcvLfG+xI
6OZG+L11bTE4j9eh4P66RZocXG4yuo0Ed9cwChKQIko7M+D0UAH1gZrM7Cwxsqzy
tZ7zqK+zKNPkSy7461GCfLXmdSgn4vFGaIbTB0bLTklhNr3JEY1IGJFQEsQIfdaB
eAEnvuKCl+KXxIKNb2GMydEMT9M/vm+bKWQ2HzIvmlxzz0W0FMUsOKde2qzjKk+f
vtX2Ch3sAjwBZKszeXtN9yPuFa49qdwdH0vyktXIs4CBE6CKJtSh1+GMjhcXEvme
I16peQR6JZiLaYm6hfyE03lc2vHs83XC9zNtC6uqa2EzqbW3jHjbdxAJq1aZ/wRQ
Zet5oB7drzcHNsjzMB8igdh3FfTs36+puH+OFgC0ILoNfqnYQuEqbOFtM5cGPc5W
zy6d19bht/qv+8R4A6N9yZkyZT/GyAl5SNVV8x9DUMq/gSuMg7n4brIf+YXGJ7Zq
hMklCWIkC68hMl+kAjLv
=4g2M
-----END PGP SIGNATURE-----

--HWIO8fHaICp2uIixNxXDqP4bqVfDHt94S--

