Hello community, here is the log from the commit of package python-keyring for openSUSE:Factory checked in at 2017-12-03 10:08:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-keyring (Old) and /work/SRC/openSUSE:Factory/.python-keyring.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-keyring" Sun Dec 3 10:08:24 2017 rev:27 rq:546273 version:10.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-keyring/python-keyring.changes 2017-08-24 18:18:12.222401006 +0200 +++ /work/SRC/openSUSE:Factory/.python-keyring.new/python-keyring.changes 2017-12-03 10:08:25.277896197 +0100 @@ -1,0 +2,8 @@ +Tue Nov 28 12:22:03 UTC 2017 - mimi.vx@gmail.com + +- update to 10.5.0: + * Added --list-backends option to command-line interface. + * Removed logger from keyring + * Set the appid for SecretService & KWallet to something meaningful + +------------------------------------------------------------------- Old: ---- keyring-10.4.0.tar.gz New: ---- keyring-10.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-keyring.spec ++++++ --- /var/tmp/diff_new_pack.hJosHq/_old 2017-12-03 10:08:25.729879764 +0100 +++ /var/tmp/diff_new_pack.hJosHq/_new 2017-12-03 10:08:25.733879619 +0100 @@ -16,23 +16,24 @@ # -%bcond_without tests - %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_without tests Name: python-keyring -Version: 10.4.0 +Version: 10.5.0 Release: 0 -Url: https://github.com/jaraco/keyring Summary: Store and access your passwords safely -License: Python-2.0 and MIT +License: Python-2.0 AND MIT Group: Development/Languages/Python +Url: https://github.com/jaraco/keyring Source: https://files.pythonhosted.org/packages/source/k/keyring/keyring-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools_scm >= 1.15.0} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-SecretStorage +Requires: python-setuptools +BuildArch: noarch %if %{with tests} # Test requirements: BuildRequires: %{python_module SecretStorage} @@ -40,9 +41,6 @@ # Python 2 test requirements: BuildRequires: python-mock %endif -Requires: python-SecretStorage -Requires: python-setuptools -BuildArch: noarch %python_subpackages %description @@ -71,7 +69,6 @@ %endif %files %{python_files} -%defattr(-,root,root) %doc README.rst CHANGES.rst %python3_only %{_bindir}/keyring %{python_sitelib}/keyring-%{version}-py*.egg-info ++++++ keyring-10.4.0.tar.gz -> keyring-10.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/.travis-osx new/keyring-10.5.0/.travis-osx --- old/keyring-10.4.0/.travis-osx 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/.travis-osx 2017-11-13 02:12:26.000000000 +0100 @@ -3,3 +3,4 @@ brew install python3 rm /usr/local/bin/python ln -s python3 /usr/local/bin/python +python -m pip install --upgrade tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/.travis.yml new/keyring-10.5.0/.travis.yml --- old/keyring-10.4.0/.travis.yml 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/.travis.yml 2017-11-13 02:12:26.000000000 +0100 @@ -1,34 +1,36 @@ language: python -python: - - 2.7 - - 3.3 - - 3.4 - - 3.5 - - 3.6 -matrix: + +jobs: + fast_finish: true include: + - python: 2.7 + - python: 3.3 + - python: &latest_py3 3.6 - os: osx language: generic + - stage: deploy + if: tag IS present + python: *latest_py3 + install: skip + script: skip + deploy: + provider: pypi + on: + tags: true + all_branches: true + user: jaraco + password: + secure: aDqlVdm6FZ8pqLkoDRR2LH3TEz7pBvKH2HhOlSy7OEmopN/36ncql/KvfE0ccpaOES9Xm31a51bUfNjcwb1HVKjfW544C+IoSHctkG1rI5bp3q4rW+4RbQcBZVHUUKR9yQf9ZyikEmoYXi3g+JKcOf9rj+v/32PAfUDzSpFbWik= + distributions: dists + skip_cleanup: true + skip_upload_docs: true + +cache: pip before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source .travis-osx; fi install: -- python -m pip install tox "setuptools>=28.2" -script: -- tox -- -rs -v -branches: - except: - - skeleton -deploy: - provider: pypi - server: https://upload.pypi.org/legacy/ - on: - tags: true - all_branches: true - python: 3.6 - user: jaraco - password: - secure: aDqlVdm6FZ8pqLkoDRR2LH3TEz7pBvKH2HhOlSy7OEmopN/36ncql/KvfE0ccpaOES9Xm31a51bUfNjcwb1HVKjfW544C+IoSHctkG1rI5bp3q4rW+4RbQcBZVHUUKR9yQf9ZyikEmoYXi3g+JKcOf9rj+v/32PAfUDzSpFbWik= - distributions: dists - skip_upload_docs: true +- pip install tox + +script: tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/CHANGES.rst new/keyring-10.5.0/CHANGES.rst --- old/keyring-10.4.0/CHANGES.rst 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/CHANGES.rst 2017-11-13 02:12:26.000000000 +0100 @@ -1,3 +1,15 @@ +10.5.0 +------ + +* #287: Added ``--list-backends`` option to + command-line interface. + +* Removed ``logger`` from ``keyring``. See #291 for related + request. + +* #292: Set the appid for SecretService & KWallet to + something meaningful. + 10.4.0 ------ @@ -487,7 +499,7 @@ * Removed support for Python 2.5. * Removed names in ``keyring.backend`` moved in 1.1 and previously retained - for compatibilty. + for compatibility. 2.1.1 ----- @@ -789,7 +801,7 @@ location or make assumptions about the storage location will need to take this change into consideration. Additionally, after upgrading to 0.8, it is not possible to downgrade to 0.7 without manually moving -configuration files. In 1.0, the backward compatibilty +configuration files. In 1.0, the backward compatibility will be removed. 0.7.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/LICENSE new/keyring-10.5.0/LICENSE --- old/keyring-10.4.0/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/keyring-10.5.0/LICENSE 2017-11-13 02:12:26.000000000 +0100 @@ -0,0 +1,7 @@ +Copyright Jason R. Coombs + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/PKG-INFO new/keyring-10.5.0/PKG-INFO --- old/keyring-10.4.0/PKG-INFO 2017-06-24 13:09:25.000000000 +0200 +++ new/keyring-10.5.0/PKG-INFO 2017-11-13 02:12:50.000000000 +0100 @@ -1,21 +1,22 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: keyring -Version: 10.4.0 +Version: 10.5.0 Summary: Store and access your passwords safely. Home-page: https://github.com/jaraco/keyring Author: Jason R. Coombs Author-email: jaraco@jaraco.com License: UNKNOWN +Description-Content-Type: UNKNOWN Description: .. image:: https://img.shields.io/pypi/v/keyring.svg :target: https://pypi.org/project/keyring .. image:: https://img.shields.io/pypi/pyversions/keyring.svg - .. image:: https://img.shields.io/pypi/dm/keyring.svg - .. image:: https://img.shields.io/travis/jaraco/keyring/master.svg :target: http://travis-ci.org/jaraco/keyring + .. image:: https://readthedocs.org/projects/keyring/badge/?version=latest + :target: http://keyring.readthedocs.io/en/latest/?badge=latest ======================================= Installing and Using Python Keyring Lib @@ -27,7 +28,7 @@ What is Python keyring lib? --------------------------- - The Python keyring lib provides a easy way to access the system keyring service + The Python keyring lib provides an easy way to access the system keyring service from python. It can be used in any application that needs safe password storage. The keyring library is licensed under both the `MIT license @@ -42,8 +43,8 @@ `secretstorage https://pypi.python.org/pypi/secretstorage`_) * `KWallet https://en.wikipedia.org/wiki/KWallet`_ (requires `dbus https://pypi.python.org/pypi/dbus-python`_) - * `Windows Credential Vault - http://windows.microsoft.com/en-us/windows7/what-is-credential-manager`_ + * `Windows Credential Locker + https://docs.microsoft.com/en-us/windows/uwp/security/credential-locker`_ Other keyring implementations are provided in the `keyrings.alt package`_. @@ -220,7 +221,7 @@ # invoke the keyring lib try: keyring.set_password("demo-service", "tarek", "passexample") - print("password stored sucessfully") + print("password stored successfully") except keyring.errors.PasswordSetError: print("failed to store password") print("password", keyring.get_password("demo-service", "tarek")) @@ -362,3 +363,4 @@ Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Requires-Python: >=2.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/README.rst new/keyring-10.5.0/README.rst --- old/keyring-10.4.0/README.rst 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/README.rst 2017-11-13 02:12:26.000000000 +0100 @@ -3,11 +3,11 @@ .. image:: https://img.shields.io/pypi/pyversions/keyring.svg -.. image:: https://img.shields.io/pypi/dm/keyring.svg - .. image:: https://img.shields.io/travis/jaraco/keyring/master.svg :target: http://travis-ci.org/jaraco/keyring +.. image:: https://readthedocs.org/projects/keyring/badge/?version=latest + :target: http://keyring.readthedocs.io/en/latest/?badge=latest ======================================= Installing and Using Python Keyring Lib @@ -19,7 +19,7 @@ What is Python keyring lib? --------------------------- -The Python keyring lib provides a easy way to access the system keyring service +The Python keyring lib provides an easy way to access the system keyring service from python. It can be used in any application that needs safe password storage. The keyring library is licensed under both the `MIT license @@ -34,8 +34,8 @@ `secretstorage https://pypi.python.org/pypi/secretstorage`_) * `KWallet https://en.wikipedia.org/wiki/KWallet`_ (requires `dbus https://pypi.python.org/pypi/dbus-python`_) -* `Windows Credential Vault - http://windows.microsoft.com/en-us/windows7/what-is-credential-manager`_ +* `Windows Credential Locker + https://docs.microsoft.com/en-us/windows/uwp/security/credential-locker`_ Other keyring implementations are provided in the `keyrings.alt package`_. @@ -212,7 +212,7 @@ # invoke the keyring lib try: keyring.set_password("demo-service", "tarek", "passexample") - print("password stored sucessfully") + print("password stored successfully") except keyring.errors.PasswordSetError: print("failed to store password") print("password", keyring.get_password("demo-service", "tarek")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/appveyor.yml new/keyring-10.5.0/appveyor.yml --- old/keyring-10.4.0/appveyor.yml 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/appveyor.yml 2017-11-13 02:12:26.000000000 +0100 @@ -16,8 +16,6 @@ test_script: - "python -m pip install tox" - - "tox -- -rs -v" + - "tox" -branches: - except: - - skeleton +version: '{build}' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/conftest.py new/keyring-10.5.0/conftest.py --- old/keyring-10.4.0/conftest.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/conftest.py 2017-11-13 02:12:26.000000000 +0100 @@ -5,6 +5,6 @@ ] if platform.system() != 'Darwin': - collect_ignore.append('keyring/backends/_OS_X_API.py') + collect_ignore.append('keyring/backends/_OS_X_API.py') collect_ignore.append('keyring/devpi_client.py') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/hook-keyring.backend.py new/keyring-10.5.0/hook-keyring.backend.py --- old/keyring-10.4.0/hook-keyring.backend.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/hook-keyring.backend.py 2017-11-13 02:12:26.000000000 +0100 @@ -11,6 +11,6 @@ import pkg_resources hiddenimports.extend( - ep.module_name - for ep in pkg_resources.iter_entry_points('keyring.backends') + ep.module_name + for ep in pkg_resources.iter_entry_points('keyring.backends') ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/__init__.py new/keyring-10.5.0/keyring/__init__.py --- old/keyring-10.4.0/keyring/__init__.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/__init__.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,14 +1,16 @@ from __future__ import absolute_import -import logging -logger = logging.getLogger('keyring') - from .core import (set_keyring, get_keyring, set_password, get_password, - delete_password) + delete_password) from .getpassbackend import get_password as get_pass_get_password try: - import pkg_resources - __version__ = pkg_resources.require('keyring')[0].version + import pkg_resources + __version__ = pkg_resources.get_distribution('keyring').version except Exception: - __version__ = 'unknown' + __version__ = 'unknown' + +__all__ = ( + 'set_keyring', 'get_keyring', 'set_password', 'get_password', + 'delete_password', 'get_pass_get_password', +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/backend.py new/keyring-10.5.0/keyring/backend.py --- old/keyring-10.4.0/keyring/backend.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/backend.py 2017-11-13 02:12:26.000000000 +0100 @@ -98,6 +98,7 @@ """ raise errors.PasswordDeleteError("reason") + class Crypter(object): """Base class providing encryption and decryption """ @@ -114,6 +115,7 @@ """ pass + class NullCrypter(Crypter): """A crypter that does nothing """ @@ -128,17 +130,19 @@ def _load_backend(name): "Load a backend by name" package = backends.__package__ or backends.__name__ - mod = importlib.import_module('.'+name, package) + mod = importlib.import_module('.' + name, package) # invoke __name__ on each module to ensure it's loaded in demand-import # environments mod.__name__ + def _load_backends(): "ensure that native keyring backends are loaded" backends = 'kwallet', 'OS_X', 'SecretService', 'Windows' list(map(_load_backend, backends)) _load_plugins() + def _load_plugins(): """ Locate all setuptools entry points by the name 'keyring backends' @@ -170,6 +174,7 @@ except Exception: log.exception("Error initializing plugin %s." % ep) + @util.once def get_all_keyring(): """ @@ -188,4 +193,4 @@ all_classes = KeyringBackend._classes viable_classes = filter(is_class_viable, all_classes) return list(util.suppress_exceptions(viable_classes, - exceptions=TypeError)) + exceptions=TypeError)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/backends/OS_X.py new/keyring-10.5.0/keyring/backends/OS_X.py --- old/keyring-10.4.0/keyring/backends/OS_X.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/backends/OS_X.py 2017-11-13 02:12:26.000000000 +0100 @@ -32,7 +32,8 @@ username = '' try: - api.set_generic_password(self.keychain, service, username, password) + api.set_generic_password( + self.keychain, service, username, password) except api.Error: raise PasswordSetError("Can't store password on keychain") @@ -50,6 +51,7 @@ username = '' try: - return api.delete_generic_password(self.keychain, service, username) + return api.delete_generic_password( + self.keychain, service, username) except api.Error: raise PasswordDeleteError("Can't delete password in keychain") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/backends/SecretService.py new/keyring-10.5.0/keyring/backends/SecretService.py --- old/keyring-10.4.0/keyring/backends/SecretService.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/backends/SecretService.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,9 +1,12 @@ import logging +import sys +import os + from ..util import properties from ..backend import KeyringBackend from ..errors import (InitError, PasswordDeleteError, - ExceptionRaisedContext) + ExceptionRaisedContext) try: import secretstorage @@ -13,9 +16,10 @@ log = logging.getLogger(__name__) + class Keyring(KeyringBackend): """Secret Service Keyring""" - appid = "python-keyring" + appid = os.path.basename(sys.argv[0]) or 'Python keyring library' @properties.ClassProperty @classmethod @@ -41,14 +45,15 @@ bus = secretstorage.dbus_init() try: if hasattr(self, 'preferred_collection'): - collection = secretstorage.Collection(bus, self.preferred_collection) + collection = secretstorage.Collection( + bus, self.preferred_collection) else: collection = secretstorage.get_default_collection(bus) except exceptions.SecretStorageException as e: raise InitError("Failed to create the collection: %s." % e) if collection.is_locked(): collection.unlock() - if collection.is_locked(): # User dismissed the prompt + if collection.is_locked(): # User dismissed the prompt raise InitError("Failed to unlock the collection!") return collection @@ -72,7 +77,7 @@ "application": self.appid, "service": service, "username": username - } + } label = "Password for '%s' on '%s'" % (username, service) collection.create_item(label, attributes, password, replace=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/backends/Windows.py new/keyring-10.5.0/keyring/backends/Windows.py --- old/keyring-10.4.0/keyring/backends/Windows.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/backends/Windows.py 2017-11-13 02:12:26.000000000 +0100 @@ -21,6 +21,7 @@ except ImportError: pass + def has_pywin32(): """ Does this environment have pywin32? @@ -83,7 +84,7 @@ ) except pywintypes.error as e: e = OldPywinError.wrap(e) - if e.winerror == 1168 and e.funcname == 'CredRead': # not found + if e.winerror == 1168 and e.funcname == 'CredRead': # not found return None raise return res @@ -95,7 +96,7 @@ existing_username = existing_pw['UserName'] target = self._compound_name(existing_username, service) self._set_password(target, existing_username, - existing_pw['CredentialBlob'].decode('utf-16')) + existing_pw['CredentialBlob'].decode('utf-16')) self._set_password(service, username, text_type(password)) def _set_password(self, target, username, password): @@ -130,6 +131,7 @@ A compatibility wrapper for old PyWin32 errors, such as reported in https://bitbucket.org/kang/python-keyring-lib/issue/140/ """ + def __init__(self, orig): self.orig = orig diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/backends/_OS_X_API.py new/keyring-10.5.0/keyring/backends/_OS_X_API.py --- old/keyring-10.4.0/keyring/backends/_OS_X_API.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/backends/_OS_X_API.py 2017-11-13 02:12:26.000000000 +0100 @@ -9,9 +9,11 @@ sec_keychain_ref = sec_keychain_item_ref = c_void_p OS_status = c_int32 + class error: item_not_found = -25300 + fw = '/System/Library/Frameworks/{name}.framework/Versions/A/{name}'.format _sec = ctypes.CDLL(fw(name='Security')) _core = ctypes.CDLL(fw(name='CoreServices')) @@ -25,7 +27,6 @@ SecKeychainOpen.restype = OS_status - SecKeychainCopyDefault = _sec.SecKeychainCopyDefault SecKeychainCopyDefault.argtypes = POINTER(sec_keychain_ref), SecKeychainCopyDefault.restype = OS_status @@ -62,6 +63,7 @@ finally: _core.CFRelease(ref) + SecKeychainFindGenericPassword = _sec.SecKeychainFindGenericPassword SecKeychainFindGenericPassword.argtypes = ( sec_keychain_ref, @@ -75,35 +77,36 @@ ) SecKeychainFindGenericPassword.restype = OS_status + def find_generic_password(kc_name, service, username): - username = username.encode('utf-8') - service = service.encode('utf-8') - with open(kc_name) as keychain: - length = c_uint32() - data = c_void_p() - status = SecKeychainFindGenericPassword( - keychain, - len(service), - service, - len(username), - username, - length, - data, - None, - ) - - msg = "Can't fetch password from system" - NotFound.raise_for_status(status, msg) - - password = ctypes.create_string_buffer(length.value) - ctypes.memmove(password, data.value, length.value) - SecKeychainItemFreeContent(None, data) - return password.raw.decode('utf-8') + username = username.encode('utf-8') + service = service.encode('utf-8') + with open(kc_name) as keychain: + length = c_uint32() + data = c_void_p() + status = SecKeychainFindGenericPassword( + keychain, + len(service), + service, + len(username), + username, + length, + data, + None, + ) + + msg = "Can't fetch password from system" + NotFound.raise_for_status(status, msg) + + password = ctypes.create_string_buffer(length.value) + ctypes.memmove(password, data.value, length.value) + SecKeychainItemFreeContent(None, data) + return password.raw.decode('utf-8') SecKeychainFindInternetPassword = _sec.SecKeychainFindInternetPassword SecKeychainFindInternetPassword.argtypes = ( - sec_keychain_ref, # keychainOrArray + sec_keychain_ref, # keychainOrArray c_uint32, # serverNameLength c_char_p, # serverName c_uint32, # securityDomainLength @@ -170,36 +173,36 @@ def find_internet_password(kc_name, service, username): - username = username.encode('utf-8') - domain = None - service = service.encode('utf-8') - path = None - port = 0 - - with open(kc_name) as keychain: - length = c_uint32() - data = c_void_p() - status = SecKeychainFindInternetPassword( - keychain, - len(service), service, - 0, domain, - len(username), username, - 0, path, - port, - SecProtocolType.kSecProtocolTypeHTTPS, - SecAuthenticationType.kSecAuthenticationTypeAny, - length, - data, - None, - ) - - msg = "Can't fetch password from system" - NotFound.raise_for_status(status, msg) - - password = ctypes.create_string_buffer(length.value) - ctypes.memmove(password, data.value, length.value) - SecKeychainItemFreeContent(None, data) - return password.raw.decode('utf-8') + username = username.encode('utf-8') + domain = None + service = service.encode('utf-8') + path = None + port = 0 + + with open(kc_name) as keychain: + length = c_uint32() + data = c_void_p() + status = SecKeychainFindInternetPassword( + keychain, + len(service), service, + 0, domain, + len(username), username, + 0, path, + port, + SecProtocolType.kSecProtocolTypeHTTPS, + SecAuthenticationType.kSecAuthenticationTypeAny, + length, + data, + None, + ) + + msg = "Can't fetch password from system" + NotFound.raise_for_status(status, msg) + + password = ctypes.create_string_buffer(length.value) + ctypes.memmove(password, data.value, length.value) + SecKeychainItemFreeContent(None, data) + return password.raw.decode('utf-8') SecKeychainAddGenericPassword = _sec.SecKeychainAddGenericPassword @@ -244,7 +247,7 @@ SecKeychainAddInternetPassword = _sec.SecKeychainAddInternetPassword SecKeychainAddInternetPassword.argtypes = ( - sec_keychain_ref, # keychainOrArray + sec_keychain_ref, # keychainOrArray c_uint32, # serverNameLength c_char_p, # serverName c_uint32, # securityDomainLength diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/backends/kwallet.py new/keyring-10.5.0/keyring/backends/kwallet.py --- old/keyring-10.4.0/keyring/backends/kwallet.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/backends/kwallet.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,5 +1,8 @@ from __future__ import absolute_import +import sys +import os + from ..backend import KeyringBackend from ..errors import PasswordDeleteError from ..errors import PasswordSetError @@ -17,7 +20,7 @@ KDE KWallet 5 via D-Bus """ - appid = 'Python program' + appid = os.path.basename(sys.argv[0]) or 'Python keyring library' wallet = None bus_name = 'org.kde.kwalletd5' object_path = '/modules/kwalletd5' @@ -48,7 +51,7 @@ entry_list = [] if self.iface.hasFolder(self.handle, old_folder, self.appid): entry_list = self.iface.readPasswordList( - self.handle, old_folder, '*@*', self.appid) + self.handle, old_folder, '*@*', self.appid) for entry in entry_list.items(): key = entry[0] @@ -56,12 +59,13 @@ username, service = key.rsplit('@', 1) ret = self.iface.writePassword( - self.handle, service, username, password, self.appid) + self.handle, service, username, password, self.appid) if ret == 0: - self.iface.removeEntry(self.handle, old_folder, key, self.appid) + self.iface.removeEntry( + self.handle, old_folder, key, self.appid) entry_list = self.iface.readPasswordList( - self.handle, old_folder, '*', self.appid) + self.handle, old_folder, '*', self.appid) if not entry_list: self.iface.removeFolder(self.handle, old_folder, self.appid) @@ -74,7 +78,7 @@ remote_obj = bus.get_object(self.bus_name, self.object_path) self.iface = dbus.Interface(remote_obj, 'org.kde.KWallet') self.handle = self.iface.open( - self.iface.networkWallet(), wId, self.appid) + self.iface.networkWallet(), wId, self.appid) except dbus.DBusException: self.handle = -1 if self.handle < 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/cli.py new/keyring-10.5.0/keyring/cli.py --- old/keyring-10.4.0/keyring/cli.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/cli.py 2017-11-13 02:12:26.000000000 +0100 @@ -7,24 +7,33 @@ from optparse import OptionParser import sys -from . import get_keyring, set_keyring, get_password, set_password, delete_password from . import core +from . import backend +from . import get_keyring, set_keyring, get_password, set_password, delete_password class CommandLineTool(object): def __init__(self): self.parser = OptionParser( - usage="%prog [get|set|del] SERVICE USERNAME") + usage="%prog [get|set|del] SERVICE USERNAME") self.parser.add_option("-p", "--keyring-path", dest="keyring_path", default=None, help="Path to the keyring backend") self.parser.add_option("-b", "--keyring-backend", dest="keyring_backend", default=None, help="Name of the keyring backend") + self.parser.add_option("--list-backends", + action="store_true", + help="List keyring backends and exit") def run(self, argv): opts, args = self.parser.parse_args(argv) + if opts.list_backends: + for k in backend.get_all_keyring(): + print(k) + return + try: kind, service, username = args except ValueError: @@ -39,8 +48,7 @@ try: if opts.keyring_path: sys.path.insert(0, opts.keyring_path) - backend = core.load_keyring(opts.keyring_backend) - set_keyring(backend) + set_keyring(core.load_keyring(opts.keyring_backend)) except (Exception,): # Tons of things can go wrong here: # ImportError when using "fjkljfljkl" @@ -66,7 +74,7 @@ elif kind == 'del': password = self.input_password("Deleting password for '%s' in '%s': " % - (username, service)) + (username, service)) delete_password(service, username) return 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/core.py new/keyring-10.5.0/keyring/core.py --- old/keyring-10.4.0/keyring/core.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/core.py 2017-11-13 02:12:26.000000000 +0100 @@ -10,7 +10,6 @@ from .py27compat import configparser, filter from .py33compat import max -from . import logger from . import backend from .util import platform_ as platform from .backends import fail @@ -20,6 +19,7 @@ _keyring_backend = None + def set_keyring(keyring): """Set current keyring backend. """ @@ -53,7 +53,9 @@ _keyring_backend.delete_password(service_name, username) -recommended = lambda backend: backend.priority >= 1 +def recommended(backend): return backend.priority >= 1 + + by_priority = operator.attrgetter('priority') @@ -130,12 +132,14 @@ raise configparser.NoOptionError('backend', 'default-keyring') except (configparser.NoOptionError, ImportError): + logger = logging.getLogger('keyring') logger.warning("Keyring config file contains incorrect values.\n" + "Config file: %s" % keyring_cfg) return return load_keyring(keyring_name) + def _load_keyring_path(config): "load the keyring-path option (if present)" try: @@ -144,5 +148,6 @@ except (configparser.NoOptionError, configparser.NoSectionError): pass + # init the _keyring_backend init_backend() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/credentials.py new/keyring-10.5.0/keyring/credentials.py --- old/keyring-10.4.0/keyring/credentials.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/credentials.py 2017-11-13 02:12:26.000000000 +0100 @@ -3,6 +3,7 @@ from .py27compat import add_metaclass + @add_metaclass(abc.ABCMeta) class Credential(object): """Abstract class to manage credentials @@ -16,6 +17,7 @@ def password(self): return None + class SimpleCredential(Credential): """Simple credentials implementation """ @@ -32,6 +34,7 @@ def password(self): return self._password + class EnvironCredential(Credential): """Source credentials from environment variables. Actual sourcing is deferred until requested. @@ -46,7 +49,7 @@ """ value = os.environ.get(env_var) if not value: - raise ValueError('Missing environment variable:%s' %env_var) + raise ValueError('Missing environment variable:%s' % env_var) return value @property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/devpi_client.py new/keyring-10.5.0/keyring/devpi_client.py --- old/keyring-10.4.0/keyring/devpi_client.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/devpi_client.py 2017-11-13 02:12:26.000000000 +0100 @@ -5,6 +5,7 @@ hookimpl = HookimplMarker("devpiclient") + @hookimpl() def devpiclient_get_password(url, username): - return keyring.get_password(url, username) + return keyring.get_password(url, username) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/errors.py new/keyring-10.5.0/keyring/errors.py --- old/keyring-10.4.0/keyring/errors.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/errors.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,22 +1,27 @@ import sys + class PasswordSetError(Exception): """Raised when the password can't be set. """ + class PasswordDeleteError(Exception): """Raised when the password can't be deleted. """ + class InitError(Exception): """Raised when the keyring could not be initialised """ + class ExceptionRaisedContext(object): """ An exception-trapping context that indicates whether an exception was raised. """ + def __init__(self, ExpectedException=Exception): self.ExpectedException = ExpectedException self.exc_info = None @@ -30,6 +35,7 @@ return self.exc_info.type and issubclass( self.exc_info.type, self.ExpectedException) + class ExceptionInfo(object): def __init__(self, *info): if not info: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/http.py new/keyring-10.5.0/keyring/http.py --- old/keyring-10.4.0/keyring/http.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/http.py 2017-11-13 02:12:26.000000000 +0100 @@ -16,6 +16,7 @@ from . import get_password, delete_password, set_password + class PasswordMgr(object): def get_username(self, realm, authuri): return getpass.getuser() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/py27compat.py new/keyring-10.5.0/keyring/py27compat.py --- old/keyring-10.4.0/keyring/py27compat.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/py27compat.py 2017-11-13 02:12:26.000000000 +0100 @@ -30,6 +30,8 @@ filter = filter # Taken from six.py + + def add_metaclass(metaclass): """Class decorator for creating a class with a metaclass.""" def wrapper(cls): @@ -41,6 +43,7 @@ return metaclass(cls.__name__, cls.__bases__, orig_vars) return wrapper + try: import builtins except ImportError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/tests/backends/test_OS_X.py new/keyring-10.5.0/keyring/tests/backends/test_OS_X.py --- old/keyring-10.4.0/keyring/tests/backends/test_OS_X.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/tests/backends/test_OS_X.py 2017-11-13 02:12:26.000000000 +0100 @@ -4,8 +4,10 @@ from ..test_backend import BackendBasicTests from keyring.backends import OS_X + def is_osx_keychain_supported(): - return sys.platform in ('mac','darwin') + return sys.platform in ('mac', 'darwin') + @unittest.skipUnless(is_osx_keychain_supported(), "Need OS X") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/tests/backends/test_SecretService.py new/keyring-10.5.0/keyring/tests/backends/test_SecretService.py --- old/keyring-10.4.0/keyring/tests/backends/test_SecretService.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/tests/backends/test_SecretService.py 2017-11-13 02:12:26.000000000 +0100 @@ -4,18 +4,20 @@ from keyring.backends import SecretService from .. import util + @unittest.skipUnless(SecretService.Keyring.viable, - "SecretStorage package is needed for SecretServiceKeyring") + "SecretStorage package is needed for SecretServiceKeyring") class SecretServiceKeyringTestCase(BackendBasicTests, unittest.TestCase): __test__ = True def init_keyring(self): print("Testing SecretServiceKeyring; the following " - "password prompts are for this keyring") + "password prompts are for this keyring") keyring = SecretService.Keyring() keyring.preferred_collection = '/org/freedesktop/secrets/collection/session' return keyring + class SecretServiceKeyringUnitTests(unittest.TestCase): def test_supported_no_secretstorage(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/tests/backends/test_Windows.py new/keyring-10.5.0/keyring/tests/backends/test_Windows.py --- old/keyring-10.4.0/keyring/tests/backends/test_Windows.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/tests/backends/test_Windows.py 2017-11-13 02:12:26.000000000 +0100 @@ -10,7 +10,7 @@ @unittest.skipUnless(keyring.backends.Windows.WinVaultKeyring.viable, - "Needs Windows") + "Needs Windows") class WinVaultKeyringTestCase(BackendBasicTests, unittest.TestCase): def tearDown(self): # clean up any credentials created diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/tests/backends/test_kwallet.py new/keyring-10.5.0/keyring/tests/backends/test_kwallet.py --- old/keyring-10.4.0/keyring/tests/backends/test_kwallet.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/tests/backends/test_kwallet.py 2017-11-13 02:12:26.000000000 +0100 @@ -16,10 +16,11 @@ def tearDown(self): for item in self.credentials_created: - # Suppress errors, as only one pre/post migration item will be present + # Suppress errors, as only one pre/post migration item will be + # present try: self.keyring.delete_password(*item) - except: + except BaseException: pass # TODO Remove empty folders created during tests @@ -30,10 +31,15 @@ self.credentials_created.add((service, username)) if old_format: - username = username+'@'+service + username = username + '@' + service service = 'Python' - super(DBusKWalletTestCase, self).set_password(service, username, password) + super( + DBusKWalletTestCase, + self).set_password( + service, + username, + password) def check_set_get(self, service, username, password): keyring = self.keyring @@ -47,9 +53,9 @@ self.keyring = keyring = self.init_keyring() ret_password = keyring.get_password(service, username) self.assertEqual( - ret_password, password, - "Incorrect password for username: '%s' on service: '%s'. '%s' != '%s'" - % (service, username, ret_password, password)) + ret_password, password, + "Incorrect password for username: '%s' on service: '%s'. '%s' != '%s'" + % (service, username, ret_password, password)) # for the empty password self.set_password(service, username, "", True) @@ -57,18 +63,18 @@ self.keyring = keyring = self.init_keyring() ret_password = keyring.get_password(service, username) self.assertEqual( - ret_password, "", - "Incorrect password for username: '%s' on service: '%s'. '%s' != '%s'" - % (service, username, ret_password, "")) - ret_password = keyring.get_password('Python', username+'@'+service) + ret_password, "", + "Incorrect password for username: '%s' on service: '%s'. '%s' != '%s'" + % (service, username, ret_password, "")) + ret_password = keyring.get_password('Python', username + '@' + service) self.assertEqual( - ret_password, None, - "Not 'None' password returned for username: '%s' on service: '%s'. '%s' != '%s'. Passwords from old folder should be deleted during migration." - % (service, username, ret_password, None)) + ret_password, None, + "Not 'None' password returned for username: '%s' on service: '%s'. '%s' != '%s'. Passwords from old folder should be deleted during migration." + % (service, username, ret_password, None)) @unittest.skipUnless(kwallet.DBusKeyringKWallet4.viable, - "KWallet4 unavailable") + "KWallet4 unavailable") class DBusKWallet4TestCase(DBusKWalletTestCase): def init_keyring(self): return kwallet.DBusKeyringKWallet4() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/tests/test_backend.py new/keyring-10.5.0/keyring/tests/test_backend.py --- old/keyring-10.4.0/keyring/tests/test_backend.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/tests/test_backend.py 2017-11-13 02:12:26.000000000 +0100 @@ -26,9 +26,11 @@ # ensure no-ascii chars slip by - watch your editor! assert min(ord(char) for char in UNICODE_CHARS) > 127 + def is_ascii_printable(s): return all(32 <= ord(c) < 127 for c in s) + class BackendBasicTests(object): """Test for the keyring's basic functions. password_set and password_get """ @@ -92,8 +94,8 @@ def test_delete_one_in_group(self): username1 = random_string(20, self.DIFFICULT_CHARS) username2 = random_string(20, self.DIFFICULT_CHARS) - password = random_string(20, self.DIFFICULT_CHARS) - service = random_string(20, self.DIFFICULT_CHARS) + password = random_string(20, self.DIFFICULT_CHARS) + service = random_string(20, self.DIFFICULT_CHARS) self.keyring.set_password(service, username1, password) self.set_password(service, username2, password) self.keyring.delete_password(service, username1) @@ -110,7 +112,7 @@ def test_unicode_and_ascii_chars(self): source = (random_string(10, UNICODE_CHARS) + random_string(10) + - random_string(10, self.DIFFICULT_CHARS)) + random_string(10, self.DIFFICULT_CHARS)) password = random_string(20, source) username = random_string(20, source) service = random_string(20, source) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/tests/util.py new/keyring-10.5.0/keyring/tests/util.py --- old/keyring-10.4.0/keyring/tests/util.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/tests/util.py 2017-11-13 02:12:26.000000000 +0100 @@ -4,27 +4,34 @@ import random import string + class ImportKiller(object): "Context manager to make an import of a given name or names fail." + def __init__(self, *names): self.names = names + def find_module(self, fullname, path=None): if fullname in self.names: return self + def load_module(self, fullname): assert fullname in self.names raise ImportError(fullname) + def __enter__(self): self.original = {} for name in self.names: self.original[name] = sys.modules.pop(name, None) sys.meta_path.insert(0, self) + def __exit__(self, *args): sys.meta_path.remove(self) for key, value in self.original.items(): if value is not None: sys.modules[key] = value + @contextlib.contextmanager def NoNoneDictMutator(destination, **changes): """Helper context manager to make and unmake changes to a dict. @@ -52,9 +59,11 @@ """A context manager to temporarily change the os.environ""" return NoNoneDictMutator(os.environ, **changes) + ALPHABET = string.ascii_letters + string.digits -def random_string(k, source = ALPHABET): + +def random_string(k, source=ALPHABET): """Generate a random string with length <i>k</i> """ result = '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/util/__init__.py new/keyring-10.5.0/keyring/util/__init__.py --- old/keyring-10.4.0/keyring/util/__init__.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/util/__init__.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,5 +1,6 @@ import functools + def once(func): """ Decorate func so it's only ever called the first time. @@ -21,6 +22,7 @@ return func.always_returns return functools.wraps(func)(wrapper) + def suppress_exceptions(callables, exceptions=Exception): """ yield the results of calling each element of callables, suppressing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/util/escape.py new/keyring-10.5.0/keyring/util/escape.py --- old/keyring-10.4.0/keyring/util/escape.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/util/escape.py 2017-11-13 02:12:26.000000000 +0100 @@ -15,11 +15,13 @@ if PY3: def u(s): return s + def _unichr(c): return chr(c) else: def u(s): return s.decode('utf-8') + def _unichr(c): return unichr(c) @@ -30,12 +32,14 @@ ESCAPE_FMT = "_%02X" + def _escape_char(c): "Single char escape. Return the char, escaped if not already legal" if isinstance(c, int): c = _unichr(c) return c if c in LEGAL_CHARS else ESCAPE_FMT % ord(c) + def escape(value): """ Escapes given string so the result consists of alphanumeric chars and @@ -43,12 +47,14 @@ """ return "".join(_escape_char(c) for c in value.encode('utf-8')) + def _unescape_code(regex_match): ordinal = int(regex_match.group('code'), 16) if sys.version_info >= (3,): return bytes([ordinal]) return chr(ordinal) + def unescape(value): """ Inverse of escape. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/util/platform_.py new/keyring-10.5.0/keyring/util/platform_.py --- old/keyring-10.4.0/keyring/util/platform_.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/util/platform_.py 2017-11-13 02:12:26.000000000 +0100 @@ -7,14 +7,17 @@ def _settings_root_XP(): return os.path.join(os.environ['USERPROFILE'], 'Local Settings') + def _settings_root_Vista(): return os.environ.get('LOCALAPPDATA', os.environ.get('ProgramData', '.')) + def _data_root_Windows(): release, version, csd, ptype = platform.win32_ver() root = _settings_root_XP() if release == 'XP' else _settings_root_Vista() return os.path.join(root, 'Python Keyring') + def _data_root_Linux(): """ Use freedesktop.org Base Dir Specfication to determine storage @@ -24,8 +27,10 @@ root = os.environ.get('XDG_DATA_HOME', None) or fallback return os.path.join(root, 'python_keyring') + _config_root_Windows = _data_root_Windows + def _check_old_config_root(): """ Prior versions of keyring would search for the config @@ -40,10 +45,11 @@ config_file_old = os.path.join(_data_root_Linux(), 'keyringrc.cfg') if os.path.isfile(config_file_old) and not os.path.isfile(config_file_new): msg = ("Keyring config exists only in the old location " - "{config_file_old} and should be moved to {config_file_new} " - "to work with this version of keyring.") + "{config_file_old} and should be moved to {config_file_new} " + "to work with this version of keyring.") raise RuntimeError(msg.format(**locals())) + def _config_root_Linux(): """ Use freedesktop.org Base Dir Specfication to determine config @@ -55,6 +61,10 @@ root = os.environ.get(key, None) or fallback return os.path.join(root, 'python_keyring') + # by default, use Unix convention data_root = globals().get('_data_root_' + platform.system(), _data_root_Linux) -config_root = globals().get('_config_root' + platform.system(), _config_root_Linux) +config_root = globals().get( + '_config_root' + + platform.system(), + _config_root_Linux) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring/util/properties.py new/keyring-10.5.0/keyring/util/properties.py --- old/keyring-10.4.0/keyring/util/properties.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/keyring/util/properties.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,5 +1,6 @@ from collections import Callable + class ClassProperty(property): """ An implementation of a property callable on a class. Used to decorate a @@ -18,10 +19,13 @@ >>> YourClass.skillz False """ + def __get__(self, cls, owner): return self.fget.__get__(None, owner)() # borrowed from jaraco.util.dictlib + + class NonDataProperty(object): """Much like the property builtin, but only implements __get__, making it a non-data property, and can be subsequently reset. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring.egg-info/PKG-INFO new/keyring-10.5.0/keyring.egg-info/PKG-INFO --- old/keyring-10.4.0/keyring.egg-info/PKG-INFO 2017-06-24 13:09:25.000000000 +0200 +++ new/keyring-10.5.0/keyring.egg-info/PKG-INFO 2017-11-13 02:12:50.000000000 +0100 @@ -1,21 +1,22 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: keyring -Version: 10.4.0 +Version: 10.5.0 Summary: Store and access your passwords safely. Home-page: https://github.com/jaraco/keyring Author: Jason R. Coombs Author-email: jaraco@jaraco.com License: UNKNOWN +Description-Content-Type: UNKNOWN Description: .. image:: https://img.shields.io/pypi/v/keyring.svg :target: https://pypi.org/project/keyring .. image:: https://img.shields.io/pypi/pyversions/keyring.svg - .. image:: https://img.shields.io/pypi/dm/keyring.svg - .. image:: https://img.shields.io/travis/jaraco/keyring/master.svg :target: http://travis-ci.org/jaraco/keyring + .. image:: https://readthedocs.org/projects/keyring/badge/?version=latest + :target: http://keyring.readthedocs.io/en/latest/?badge=latest ======================================= Installing and Using Python Keyring Lib @@ -27,7 +28,7 @@ What is Python keyring lib? --------------------------- - The Python keyring lib provides a easy way to access the system keyring service + The Python keyring lib provides an easy way to access the system keyring service from python. It can be used in any application that needs safe password storage. The keyring library is licensed under both the `MIT license @@ -42,8 +43,8 @@ `secretstorage https://pypi.python.org/pypi/secretstorage`_) * `KWallet https://en.wikipedia.org/wiki/KWallet`_ (requires `dbus https://pypi.python.org/pypi/dbus-python`_) - * `Windows Credential Vault - http://windows.microsoft.com/en-us/windows7/what-is-credential-manager`_ + * `Windows Credential Locker + https://docs.microsoft.com/en-us/windows/uwp/security/credential-locker`_ Other keyring implementations are provided in the `keyrings.alt package`_. @@ -220,7 +221,7 @@ # invoke the keyring lib try: keyring.set_password("demo-service", "tarek", "passexample") - print("password stored sucessfully") + print("password stored successfully") except keyring.errors.PasswordSetError: print("failed to store password") print("password", keyring.get_password("demo-service", "tarek")) @@ -362,3 +363,4 @@ Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Requires-Python: >=2.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring.egg-info/SOURCES.txt new/keyring-10.5.0/keyring.egg-info/SOURCES.txt --- old/keyring-10.4.0/keyring.egg-info/SOURCES.txt 2017-06-24 13:09:25.000000000 +0200 +++ new/keyring-10.5.0/keyring.egg-info/SOURCES.txt 2017-11-13 02:12:50.000000000 +0100 @@ -3,6 +3,7 @@ .travis-osx .travis.yml CHANGES.rst +LICENSE README.rst appveyor.yml conftest.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/keyring.egg-info/requires.txt new/keyring-10.5.0/keyring.egg-info/requires.txt --- old/keyring-10.4.0/keyring.egg-info/requires.txt 2017-06-24 13:09:25.000000000 +0200 +++ new/keyring-10.5.0/keyring.egg-info/requires.txt 2017-11-13 02:12:50.000000000 +0100 @@ -13,3 +13,4 @@ [testing] pytest>=2.8 pytest-sugar +collective.checkdocs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/setup.cfg new/keyring-10.5.0/setup.cfg --- old/keyring-10.4.0/setup.cfg 2017-06-24 13:09:25.000000000 +0200 +++ new/keyring-10.5.0/setup.cfg 2017-11-13 02:12:50.000000000 +0100 @@ -2,7 +2,7 @@ release = dists upload dists = clean --all sdist bdist_wheel -[wheel] +[bdist_wheel] universal = 1 [egg_info] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/setup.py new/keyring-10.5.0/setup.py --- old/keyring-10.4.0/setup.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/setup.py 2017-11-13 02:12:26.000000000 +0100 @@ -11,6 +11,11 @@ name = 'keyring' description = 'Store and access your passwords safely.' +nspkg_technique = 'native' +""" +Does this package use "native" namespace packages or +pkg_resources "managed" namespace packages? +""" params = dict( name=name, @@ -24,7 +29,11 @@ url="https://github.com/jaraco/" + name, packages=setuptools.find_packages(), include_package_data=True, - namespace_packages=name.split('.')[:-1], + namespace_packages=( + name.split('.')[:-1] if nspkg_technique == 'managed' + else [] + ), + python_requires='>=2.7', install_requires=[ ], extras_require={ @@ -37,6 +46,7 @@ 'testing': [ 'pytest>=2.8', 'pytest-sugar', + 'collective.checkdocs', ], 'docs': [ 'sphinx', @@ -68,4 +78,4 @@ }, ) if __name__ == '__main__': - setuptools.setup(**params) + setuptools.setup(**params) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/tests/test_packaging.py new/keyring-10.5.0/tests/test_packaging.py --- old/keyring-10.4.0/tests/test_packaging.py 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/tests/test_packaging.py 2017-11-13 02:12:26.000000000 +0100 @@ -1,5 +1,6 @@ import pkg_resources + def test_entry_point(): """ Keyring provides exactly one 'keyring' console script diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/keyring-10.4.0/tox.ini new/keyring-10.5.0/tox.ini --- old/keyring-10.4.0/tox.ini 2017-06-24 13:07:55.000000000 +0200 +++ new/keyring-10.5.0/tox.ini 2017-11-13 02:12:26.000000000 +0100 @@ -2,6 +2,8 @@ minversion = 2.4 [testenv] -commands = py.test {posargs} +commands = + py.test {posargs} + python setup.py checkdocs usedevelop = True extras = testing