From 302bb7c2218331d8de32375138794060bb9e5b4c Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 23 Dec 2014 22:58:17 +0100 Subject: [PATCH] ext: Fix unpacking of VersionConflict exception Fixes #911 --- docs/changelog.rst | 6 +++++- mopidy/ext.py | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 1ef13666..19257e46 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,12 +10,16 @@ v0.19.5 (UNRELEASED) Bug fix release. -- config: Support UTF-8 in default config. If an extension with non-ASCII +- Config: Support UTF-8 in default config. If an extension with non-ASCII characters in its default config was installed, and Mopidy didn't already have a config file, Mopidy would crashed when trying to create the initial config file based on the default config of all available extensions. (Fixes: :discuss:`428`) +- Extensions: Fix crash when unpacking data from + :exc:`pkg_resources.VersionConflict` created with a single argument. (Fixes: + :issue:`911`) + - Models: Hide empty collections from :func:`repr()` representations. - Models: Field values are no longer stored on the model instance when the diff --git a/mopidy/ext.py b/mopidy/ext.py index 3333ec3f..24d85786 100644 --- a/mopidy/ext.py +++ b/mopidy/ext.py @@ -188,10 +188,13 @@ def validate_extension(extension): extension.ext_name, ex) return False except pkg_resources.VersionConflict as ex: - found, required = ex.args - logger.info( - 'Disabled extension %s: %s required, but found %s at %s', - extension.ext_name, required, found, found.location) + if len(ex.args) == 2: + found, required = ex.args + logger.info( + 'Disabled extension %s: %s required, but found %s at %s', + extension.ext_name, required, found, found.location) + else: + logger.info('Disabled extension %s: %s', extension.ext_name, ex) return False try: