[offlineimap] Setting passwords in keystore is non-trivial (#218)

Profpatsch notifications at github.com
Sun Jul 19 19:57:15 BST 2015

I use the following two functions:

import keyring

def get_password(server, username):
    return keyring.get_password(server, username)

def set_password(server, username, password):
    keyring.set_password(server, username, password)

Problem: setting the passwords is a manual act, offlineimap doesn’t use the set_password to save the password it queries.

I tried the following:

import keyring
import getpass
def get_password(server, username):
    pw = keyring.get_password(server, username)
    if not pw:
        pw = getpass.getpass("Password: ")
        set_password(server, username, password)
    return pw

but offlineimap’s multithreadedness screws that up (try it!).

What do?

Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20150719/ea694c77/attachment-0002.html>

More information about the OfflineIMAP-project mailing list