config: Fix decoding of exception message depending on locale

This commit is contained in:
Stein Magnus Jodal 2014-05-20 20:15:44 +02:00
parent dcba410d91
commit db0d726f3f
2 changed files with 9 additions and 4 deletions

View File

@ -31,6 +31,10 @@ Feature release.
release, like Mopidy 0.18, or migrate the configuration to the new format by
hand.
**Configuration**
- Fix proper decoding of exception messages that depends on the user's locale.
**Extension support**
- Removed the :class:`~mopidy.ext.Extension` methods that were deprecated in

View File

@ -26,7 +26,7 @@ sys.argv[1:] = []
from mopidy import commands, config as config_lib, ext
from mopidy.utils import log, path, process, versioning
from mopidy.utils import encoding, log, path, process, versioning
logger = logging.getLogger(__name__)
@ -149,9 +149,10 @@ def create_file_structures_and_config(args, extensions):
default = config_lib.format_initial(extensions)
path.get_or_create_file(config_file, mkdir=False, content=default)
logger.info('Initialized %s with default config', config_file)
except IOError as e:
logger.warning('Unable to initialize %s with default config: %s',
config_file, e)
except IOError as error:
logger.warning(
'Unable to initialize %s with default config: %s',
config_file, encoding.locale_decode(error))
def check_old_locations():