You are not logged in.

#1 2014-10-25 05:18:45

firef0x
Member
From: Santos, Brazil
Registered: 2014-10-23
Posts: 4
Website

[Solved] Why couldn't Python3 handle GNOME Keyring?

Hello, everyone!

I'm using Awesome WM as desktop,as well as SLiM as login manager , and python-keyring 4.0-2. The GNOME packages I've installed are as follow:

  • gnome-icon-theme

  • gnome-icon-theme-symbolic

  • gnome-keyring

  • libgnome-keyring

  • libsoup

  • python-gobject

  • seahorse

What's more, I've followed the instruction from Arch Wiki and set up the PAM config files and .xinitrc(My .xinitrc).

When I finish logging in with SLiM, I open htop immediately, and find the process gnome-keyring-daemon running. Then I open seahorse (GUI front-end of GNOME Keyring), the default keyring 'Login' is unlocked.

Hence, I think that GNOME Keyring is unlocked automatically at login in my system. Refer to https://wiki.gnome.org/Projects/GnomeKeyring/Pam

Now, I open the terminal and execute the following command:

$ python

Python 3.4.2 (default, Oct  8 2014, 13:44:52) 
[GCC 4.9.1 20140903 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyring
>>> print(keyring)
<module 'keyring' from '/usr/lib/python3.4/site-packages/keyring/__init__.py'>
>>> print(keyring.get_keyring())
<keyring.backends.file.EncryptedKeyring object at 0x7ff0189e83c8>
>>> keyring.set_password('test_server', 'test_user', 'test_password')
Please set a password for your new keyring:
Please confirm the password:

After that I open seahorse, and find no item added. What's more, there is an item added in ~/.local/share/python_keyring/crypted_pass.cfg :

[test_5Fserver]
test_5fuser = (Some encrypted code)

This means, Python3 fails to handle GNOME Keyring with Python Keyring.

=========================================

The expected response is as follow:

>>> print(keyring.get_keyring())
<keyring.backends.Gnome.Keyring object at xxxxxxxx>
>>> keyring.set_password('test_server', 'test_user', 'test_password')
>>>

Then open seahorse, there should have been a new item added in the keyring 'Login' like the picture below:
1180a948-53bb-11e4-92ee-e8e03255a56e.png

==========================================

So What's the problem? Is it a PEBKAC? How can I fix it? mad sad

Yours sincerely

Last edited by firef0x (2014-11-22 02:45:05)

Offline

#2 2014-10-25 06:52:16

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [Solved] Why couldn't Python3 handle GNOME Keyring?

Hi firef0x,

in the past python-keyring had some problem in the detection of the default keyring backend but I thought that this problem was solved a long ago (at least it detects my kwallet backend correctly). However, you can try to set your default backend manually by creating the file ~/.local/share/python_keyring/keyringrc.cfg with the following content

[backend]
default-keyring=keyring.backends.Gnome.Keyring

About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2014-11-22 02:43:33

firef0x
Member
From: Santos, Brazil
Registered: 2014-10-23
Posts: 4
Website

Re: [Solved] Why couldn't Python3 handle GNOME Keyring?

Problem solved! big_smile See https://bbs.archlinuxcn.org/viewtopic.php?id=2968 for details. Anyway, thx for @mauritiusdadd's reply!

Last edited by firef0x (2014-11-22 02:44:33)

Offline

#4 2015-07-11 16:13:54

derheld
Member
Registered: 2015-07-11
Posts: 1

Re: [Solved] Why couldn't Python3 handle GNOME Keyring?

firef0x wrote:

Problem solved! big_smile See https://bbs.archlinuxcn.org/viewtopic.php?id=2968 for details. Anyway, thx for @mauritiusdadd's reply!

And how did you solved it? Only set a link to a Chinese website don't really helps others...

Offline

Board footer

Powered by FluxBB