After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 460515 - gnome-keyring: doesn't set g_application_name
gnome-keyring: doesn't set g_application_name
Product: libgnome-keyring
Classification: Core
Component: General
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Reported: 2007-07-26 09:50 UTC by Sebastian Rittau
Modified: 2019-02-22 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Sebastian Rittau 2007-07-26 09:50:45 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.

Similar with other functions. Importing gtk in addition to gnomekeyring fixes this problem. Nevertheless the warning should not appear.
Comment 1 Gustavo Carneiro 2007-07-26 10:17:36 UTC
I defer judgement to the gnome-keyring maintainer.  Not bindings related I think.
Comment 2 Stef Walter 2007-07-26 13:08:00 UTC
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. 
Comment 3 Sebastian Rittau 2007-07-26 13:25:58 UTC
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.
Comment 4 Gustavo Carneiro 2007-07-26 13:52:04 UTC
>>> import gobject
>>> gobject.set_application_name
<built-in function set_application_name>
Comment 5 Sebastian Rittau 2007-07-26 14:58:41 UTC
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.)