From c7ec73e1f203769ba31caaf2eb0cace0dd722833 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 29 Sep 2011 14:45:56 -0400 Subject: [PATCH] CC-2891: Unicode error with metadata that contains unicode strings -reversed two changes talked about in code review. --- python_apps/api_clients/api_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index 194432743..0064a95d5 100755 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -44,7 +44,7 @@ def encode_to(obj, encoding='utf-8'): obj = obj.encode(encoding) return obj -def convert_dict_value_to_utf8: +def convert_dict_value_to_utf8(md): #list comprehension to convert all values of md to utf-8 return dict([(item[0], encode_to(item[1], "utf-8")) for item in md.items()]) @@ -427,7 +427,7 @@ class AirTimeApiClient(ApiClientInterface): if(is_record): url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_recorded"]) url = url.replace("%%fileid%%", str(response[u'id'])) - url = url.replace("%%showinstanceid%%", md['MDATA_KEY_TRACKNUMBER']) + url = url.replace("%%showinstanceid%%", str(md['MDATA_KEY_TRACKNUMBER'])) logger.debug(url) url = url.replace("%%api_key%%", self.config["api_key"])