Installation: Mageia 2 KDE 586 installed using Live CD uname -a: Linux magnum 3.3.6-desktop586-2.mga2 #1 SMP Thu May 17 16:35:38 UTC 2012 i686 i686 i386 GNU/Linux Package name: python-notify-0.1.1-7.mga2 Python module "pynotify" produces the following warning messages after it is imported: ** (process:3893): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags' ** (process:3893): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags' ** (process:3893): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags' Reproducible: Yes To produce warning messages do the following: install package python-notify-0.1.1-7.mga2 bring up a terminal window type "python" at the prompt to start interactive python session type "import pynotify" and the warning messages will appear pynotify does work but it is annoying to get these warnings messages when running a python script that uses it.
Assignee: bugsquad => makowski.mageiaSource RPM: (none) => python-notify
I got the same under Fedora seems that it have to be reported upstream
Whiteboard: (none) => NEEDHELP
may be something related to https://bugzilla.redhat.com/show_bug.cgi?id=790053 ?
cc'ing some committers of this package Hi committers, There is NEEDHELP on the whiteboard, so your help is very welcome :) Btw, is upstream dead, our is our link to it wrong? http://www.galago-project.org/news/index.php The link to the bug list doesn't work http://trac.galago-project.org/report Fedora and Suse link to galago-project.org too. If upstream moved, I don't manage to find the new site.
CC: (none) => jani.valimaa, mageia, marja11, thierry.vignaud
in fact pynotify is for Gtk2, not Gtk3 so may be we should drop it or the user have to do : "from gi.repository import Notify" instead of only "import pynotify" more reading on this : http://askubuntu.com/questions/160114/error-when-importing-pynotify http://san-ho-zay.tumblr.com/post/18557776154/using-libnotify-with-python-and-gtk3
CC: jani.valimaa => (none)
upstream dead, pynotify is for Gtk2, not Gtk3 Solution : he user have to do : "from gi.repository import Notify" instead of only "import pynotify" more reading on this : http://askubuntu.com/questions/160114/error-when-importing-pynotify http://san-ho-zay.tumblr.com/post/18557776154/using-libnotify-with-python-and-gtk3 it will not be fixed even we should drop this package.
(In reply to comment #5) > upstream dead, pynotify is for Gtk2, not Gtk3 > > Solution : > > he user have to do : > "from gi.repository import Notify" > instead of only "import pynotify" > > more reading on this : > http://askubuntu.com/questions/160114/error-when-importing-pynotify > http://san-ho-zay.tumblr.com/post/18557776154/using-libnotify-with-python-and-gtk3 > > it will not be fixed > even we should drop this package. Can you please obsolete it, then? https://wiki.mageia.org/en/Packaging_guidelines#Obsoleting_a_package
I will first try to apply this patch (http://pkgs.fedoraproject.org/cgit/notify-python.git/tree/notify-python-0.1.1-fix-GTK-symbols.patch) from Fedora
Patched version in update testing python-notify-0.1.1-8.mga2 python-notify-0.1.1-8.mga3
Trying the patched version. Still generates the same warnings for me when importing pynotify in an interactive session. ** (process:4263): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags' ** (process:4263): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags' ** (process:4263): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
so I have no solution an under Fedora, some times it appends, some time not
Do you aggree if I obsolete this package, and package instead this one : http://pypi.python.org/pypi/notify2 ? Quoted from http://www.mail-archive.com/debian-python@lists.debian.org/msg08784.html This is intended as a replacement for pynotify (aka notify-python, python-notify), so it broadly copies the API from that package, although it's not a drop in replacement. Why is a replacement needed? - notify2 is compatible with Gtk 3 and Qt 4. pynotify can't even be imported in the same process as the gobject introspection bindings for Gtk 3, and its callbacks depend on the Gtk 2 event loop. - notify2 is compatible with Python 3; pynotify probably can't easily be made to support Python 3. - notify2 has useful docstrings and function signatures for introspection - Getting things wrong with pynotify can easily segfault your process. notify2 should just raise a Python exception. - notify2 is written in Python, not C, so it's shorter, more readable, and easier to maintain.
Created attachment 2856 [details] Work around solution to suppress pynotify warning messages
Lost my comments with the attachment. Here they are: Found a work around solution by lunaryorn on stackoverflow.com: http://stackoverflow.com/questions/11567930/gtk-errors-when-importing-pynotify It works in my applications.
In fact the bug is in gtk module, when you do "import pynotify" , __init__.py do import gtk python Python 2.7.3 (default, Jan 13 2013, 20:09:12) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gtk ** (process:10833): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags' ** (process:10833): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags' ** (process:10833): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags' Gtk-Message: Failed to load module "canberra-gtk-module" >>> so the bug have to be reported and fixed in gtk module
Source RPM: python-notify => python-notify pygtk2.0
The initial reported bug was in fact in python-gobject, not in python-notify *** This bug has been marked as a duplicate of bug 10176 ***
Status: NEW => RESOLVEDResolution: (none) => DUPLICATESource RPM: python-notify pygtk2.0 => python-notify python-gobjectWhiteboard: NEEDHELP => (none)