CC-2891: Unicode error with metadata that contains unicode strings

-reversed two changes talked about in code review.
This commit is contained in:
martin 2011-09-29 14:45:56 -04:00
parent 4e105e6151
commit c7ec73e1f2
1 changed files with 2 additions and 2 deletions

View File

@ -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"])