GNOME Bugzilla – Bug 460515
gnome-keyring: doesn't set g_application_name
Last modified: 2019-02-22 11:46:15 UTC
Consider the following simple program: import gnomekeyring as gk print gk.get_default_keyring_sync() This prints the following warning: ** (process:30203): WARNING **: g_set_application_name not set. default Similar with other functions. Importing gtk in addition to gnomekeyring fixes this problem. Nevertheless the warning should not appear.
I defer judgement to the gnome-keyring maintainer. Not bindings related I think.
It's important that the application call g_set_application_name(), otherwise if/when gnome keyring prompts the user that an application is requesting access, the dialog won't have anything in it.
I think it's a binding problem, mainly because pygtk does not offer the ability to set the application name, so there's nothing an application developer can do, except importing gtk. (A rather unobvious workaround.) This differs from the situation with the C library, since glib offers a g_set_application_name function. Therefore this is possibly a pygtk issue, not a python-gnome-support or gnome-keyring issue. Nevertheless I would suggest that python-gnome-support throws a Python exception with a detailed explanation if g_get_application_name is NULL. This provides a proper Python-way of handling the problem.
>>> import gobject >>> gobject.set_application_name <built-in function set_application_name>
Ah, didn't know that this function was added in Subversion. This basically fixes my problem. (Although I would still prefer a Python exception to a glib assertion. But this would probably mean overriding lots of functions by hand, so it's probably not worth it.)