title: Get attributes of GnomeKeyring key with Python 2.7 GTK3 on Ubuntu 14.04
body: <p>I am using Linux Mint 17, based on Ubuntu 14.04</p>
  
  <p>I have installed:</p>
  
  <p>python-gnomekeyring 2.3.2
  python-gi 3.12
  python-gtk2 2.24</p>
  
  <p>I want to use the GnomeKeyring. I save and read a key name an key password, but I annot access the attributes. When I try to access them I always get:</p>
  
  <blockquote>
    <p>*** Error in `python': double free or corruption (out)</p>
  </blockquote>
  
  <p>Here is my code, I created this today to work with the GnomeKeyring:</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf8 -*-
  
  
  import gi
  gi.require_version('Gtk', '3.0')
  gi.require_version('GnomeKeyring', '1.0')
  from gi.repository import Gtk
  from gi.repository import GnomeKeyring
  
  import logging
  from pprint import pprint
  
  
  class KeyringManager():
  
      def __init__(self):
          pass
  
      def create_key(self, keyring_name, key_name, attributes=None):
          logging.warning("create_key: %s / %s", keyring_name, key_name)
          self.unlock_keyring(keyring_name)
          key_id = self.get_key_id(keyring_name, key_name)
          if key_id:
              logging.warning("key already exists, overwriting now, press return key to continue")
              raw_input()
          attrs = GnomeKeyring.Attribute.list_new()
          for key, value in attributes.items():
              GnomeKeyring.Attribute.list_append_string(attrs, key, value)
          GnomeKeyring.item_create_sync(keyring_name, GnomeKeyring.ItemType.GENERIC_SECRET, key_name, attrs, raw_input("please enter password for key '{}': ".format(key_name)), True)
  
      def unlock_keyring(self, keyring_name):
          logging.warning("unlock_keyring: %s", keyring_name)
          # check if keyring exists
          (result, info) = GnomeKeyring.get_info_sync(keyring_name)
          if result == GnomeKeyring.Result.NO_SUCH_KEYRING:
              logging.warning("keyring does not exists: %s", keyring_name)
              self.create_keyring(keyring_name)
          result = GnomeKeyring.unlock_sync(keyring_name, None)
          pprint(result.value_name)
  
      def create_keyring(self, keyring_name):
          logging.warning("create_keyring: %s", keyring_name)
          result = GnomeKeyring.create_sync(keyring_name, raw_input("please enter passwort for new keyring '{}': ".format(keyring_name)))
          pprint(result)
  
      def get_key_id(self, keyring_name, key_name):
          logging.warning("get_key_id: %s / %s", keyring_name, key_name)
          (result, key_ids) = GnomeKeyring.list_item_ids_sync(keyring_name)
          for key_id in key_ids:
              (result, item) = GnomeKeyring.item_get_info_sync(keyring_name, key_id)
              if item.get_display_name() == key_name:
                  return key_id
  
      def get_key_info(self, keyring_name, key_name):
          logging.warning("get_key_info: %s / %s", keyring_name, key_name)
          self.unlock_keyring(keyring_name)
          key_id = self.get_key_id(keyring_name, key_name)
          GnomeKeyring.item_get_info_sync (keyring_name, key_id)
          (result, item) = GnomeKeyring.item_get_info_sync(keyring_name, key_id)
          self.key_name = item.get_display_name()
          self.secret = item.get_secret()
          self.attrs = GnomeKeyring.Attribute.list_new()
          result = GnomeKeyring.item_get_attributes_sync(keyring_name, key_id, self.attrs)#
          try:
              for attr in GnomeKeyring.Attribute.list_to_glist(self.attrs):
                  ## *** Error in `python': double free or corruption (out)
                  print '%s = %s ' % (attr.name, attr.get_string())
          except Exception, e:
              logging.error(e.message, exc_info=True)
              exit(e.message)
  
      def delete_key(self, keyring_name="login", key_name="==THENAME"):
          logging.warning("delete_key: %s / %s", keyring_name, key_name)
          raw_input("press return key to continue")
          logging.error("not implemented yet")
          #GnomeKeyring.item_delete_sync(keyring, id)
  
  
  #KeyringManager().create_key("my_keyring", "my_key", {"user":"carl", "url":"apple.de", "port":"1212"})
  KeyringManager().get_key_info("my_keyring", "my_key")
  </code></pre>
  
  <p>some links:</p>
  
  <p><a href="https://github.com/lwindolf/liferea/blob/master/plugins/gnome-keyring.py" rel="nofollow noreferrer">https://github.com/lwindolf/liferea/blob/master/plugins/gnome-keyring.py</a></p>