From cfb952f108b4ed11f2206848b1762e6760507ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sun, 20 Jul 2014 16:45:03 +0200 Subject: [PATCH] [fix] Encode strings before concatenation to ask_string in hook --- hook.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hook.py b/hook.py index 90ad01d9e..f9d2e9b9b 100644 --- a/hook.py +++ b/hook.py @@ -129,7 +129,7 @@ def hook_exec(file, args=None): args -- Arguments to pass to the script """ - from yunohost.app import _value_for_locale + from yunohost.app import _value_for_locale, _encode_string if isinstance(args, list): arg_list = args @@ -152,9 +152,11 @@ def hook_exec(file, args=None): # Append extra strings if 'choices' in arg: - ask_string += ' (%s)' % '|'.join(arg['choices']) + ask_string += ' ({:s})'.format( + _encode_string('|'.join(arg['choices']))) if 'default' in arg: - ask_string += ' (default: %s)' % arg['default'] + ask_string += ' (default: {:s})'.format( + _encode_string(arg['default'])) input_string = msignals.prompt(ask_string)