X2Go Bug report logs - #989
pyhoca-gui fails to fall back to Gtk-2.0 notifications (pynotify)

version graph

Package: pyhoca-gui; Maintainer for pyhoca-gui is X2Go Developers <x2go-dev@lists.x2go.org>; Source for pyhoca-gui is src:pyhoca-gui.

Reported by: Ondřej Grover <ondrej.grover@gmail.com>

Date: Sun, 31 Jan 2016 08:05:02 UTC

Severity: normal

Found in version 0.5.0.5-0x2go1+git20160128.1329+jessie.main.1

Full log


Message #20 received at 989@bugs.x2go.org (full text, mbox, reply):

Received: (at 989) by bugs.x2go.org; 4 Feb 2016 23:20:41 +0000
From ionic@ionic.de  Fri Feb  5 00:20:37 2016
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 527B55DA90
	for <989@bugs.x2go.org>; Fri,  5 Feb 2016 00:20:37 +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 zatuhVaQBTIg for <989@bugs.x2go.org>;
	Fri,  5 Feb 2016 00:20:37 +0100 (CET)
Received: from Root24.de (powered.by.root24.eu [5.135.3.88])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id F2ACF5DA86
	for <989@bugs.x2go.org>; Fri,  5 Feb 2016 00:20:36 +0100 (CET)
Received: from nopileos.local (home.ionic.de [217.92.117.31])
	by mail.ionic.de (Postfix) with ESMTPSA id EEC2C4F00DDC;
	Fri,  5 Feb 2016 00:20:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ionic.de; s=default;
	t=1454628036; bh=/nINmoAORC1yXYDXyOSldG0GsuQbGxcxIjY76D3UneU=;
	h=Subject:To:References:From:Cc:Date:In-Reply-To:From;
	b=CSXQgOyg9SWXWgJMTDD4ykC2hRTh1sot7W0MoenH5AwayG9vbRTZCi226LBAAycJb
	 muQSQqbBwyium9fCVOJp+e7WbhMo7BtnYWasq4j0uXsjx9eNUBH9qKzWZC7UmMmAPg
	 510UFj2Lg10eWXkcBlyngKPgGTz3aXXS9/UnRW3Q=
Subject: Re: [X2Go-Dev] pyhoca-gui fails to fall back to Gtk-2.0 notifications
 (pynotify)
To: Ondřej Grover <ondrej.grover@gmail.com>,
 989@bugs.x2go.org
References: <CAOyjJOKY4VpqcqKJ2St58tepAgKipgdc=TeGJtgsFpZf5qccdA@mail.gmail.com>
 <56B38113.70103@ionic.de>
 <CAOyjJOKCw0QkwfB45NmUaSNkoYeeOygfsS3xY=BFpZdtgeYjEA@mail.gmail.com>
From: Mihai Moldovan <ionic@ionic.de>
X-Enigmail-Draft-Status: N1110
Cc: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Message-ID: <56B3DCC2.5090704@ionic.de>
Date: Fri, 5 Feb 2016 00:20:34 +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: <CAOyjJOKCw0QkwfB45NmUaSNkoYeeOygfsS3xY=BFpZdtgeYjEA@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="ohOV3PmX1ktInVVmJlKs0DoDXrRQKlwjp"
[Message part 1 (text/plain, inline)]
On 04.02.2016 06:07 PM, Ondřej Grover wrote:
> Thank you for looking into this.
> 
> On Thu, Feb 4, 2016 at 5:49 PM, Mihai Moldovan <ionic@ionic.de
> <mailto:ionic@ionic.de>> wrote:
> 
>     I've been looking around for a way to actually rollback a failing module import
>     and came up with zit.
> 
> AFAIK that's not really possible in Python as of writing this, especially with
> complicated binary modules.
> I think a solution might be to abandon the common Python EAFP idiom, because it
> assumes graceful failure without such ugly side-effects. However, I'm not sure
> what the LBYL alternative is in this case. But I think there should be one,
> possibly loading just some high-level gi module to list available APIs?

Probably not.

In a new python2 interpreter, try this:

import sys
print sys.modules
import gi.repository
print sys.modules

I guess gi.repository is the only module that could be used to query additional
modules (like Notify.)

The modules list explodes. With GI, we end up in GI hell. And there's no exit.
Ever. Again.


I'd rather suggest the following: another try block, looking for pynotify2.

On Debian, I'd switch the dependencies to use gir1.2-notify-0.7 and python-gi,
or python-notify2 (dropping python-notify completely), while *SUSE, EPEL and
Fedora will continue depending upon the GI modules for newer versions and
pynotify for older versions (at least Fedora doesn't seem to have pynotify2.)

It should probably work as a drop-in replacement for pynotify in our case (i.e.,
we don't use any callbacks or anything fancy.)

Going forward, the deprecated gobject modules for GTK2 will likely be removed at
some point anyway and we should focus on GTK3.

Any objections?



Mihai

[signature.asc (application/pgp-signature, attachment)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Fri Apr 19 14:25:34 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.