Passwords on OS X via security

Lucien Pullen drurowin at
Fri Nov 14 06:32:00 GMT 2014

The `keyring' package is installed with either pip or easy_install.  It
is not distributed with Python.

Also sprach Nicolas Sebrecht on 2014-11-13:
> Now, if you really want to use a shell command instead of pure python
> code you could call your shell command from python with a call like
> Popen(). See
> and
> for details.
> I would encourage you to try something like that in a python session:
>   % python
>   >>> import subprocess
>   >>> import shlex
>   >>> subprocess.Popen(shlex.split('ls /'), stdout=subprocess.PIPE)
> which returns a string 'str' as expected in offlineimaprc.
> Good luck! ,-)

This will not work, unless I'm trying to use anonymous functions
incorrectly.  Calling "import foo" from a lambda will result in an
error (Python 2.7):

--8<---------------cut here---------------start------------->8---
>>> lambda: import keyring
  File "<stdin>", line 1
    lambda: import keyring
SyntaxError: invalid syntax
--8<---------------cut here---------------end--------------->8---

You will need to perform any imports in a .py file.  You mentioned that
an auxiliary file was unwanted, but you may need one.

That or a config option for loading dependent libraries needs to be
added (very specific change for a very specific problem, but that's the
only reason I use a .py file, so maybe an ok one if enough people do

More information about the OfflineIMAP-project mailing list