bzexport: pass str to prompt_menu (
bug 1183656); r?njn
prompt_menu expects a str message. search_results['search_string']
is a unicode type. When interpolated, Python 2 unhelpfully implicitly
converts the literal str to a unicode. This later triggers
implicit conversion back to a str assuming the ASCII encoding.
MozReview-Commit-ID: CRvZxTmJQom
--- a/hgext/bzexport/__init__.py
+++ b/hgext/bzexport/__init__.py
@@ -160,17 +160,17 @@ def choose_value(ui, desc, options, mess
elif usemenu:
return prompt_menu(ui, desc, list(options), message=message)
return None
def multi_user_prompt(ui, desc, search_results):
return prompt_menu(ui, desc, search_results['names'],
readable_values=search_results['real_names'],
- message="Multiple bugzilla users matching \"%s\":\n\n" % search_results["search_string"],
+ message="Multiple bugzilla users matching \"%s\":\n\n" % search_results["search_string"].encode('utf-8', 'replace'),
allow_none=True)
# Returns [ { search_string: original, names: [ str ], real_names: [ str ] } ]
def find_users(ui, api_server, user_cache_filename, auth, search_strings):
c = bzauth.load_user_cache(ui, api_server, user_cache_filename)
section = api_server