diff --git a/trello/board.py b/trello/board.py index 23bf03a3..28d4c80d 100644 --- a/trello/board.py +++ b/trello/board.py @@ -51,11 +51,12 @@ def from_json(cls, trello_client=None, organization=None, json_obj=None): :json_obj: the json board object """ if organization is None: - board = Board(client=trello_client, board_id=json_obj['id'], name=json_obj['name'].encode('utf-8')) + board = Board(client=trello_client, board_id=json_obj['id'], name=json_obj['name'].encode('utf-8').decode('utf-8')) else: - board = Board(organization=organization, board_id=json_obj['id'], name=json_obj['name'].encode('utf-8')) + board = Board(organization=organization, board_id=json_obj['id'], name=json_obj['name'].encode('utf-8').decode('utf-8')) - board.description = json_obj.get('desc', '').encode('utf-8') + board.description = json_obj.get('desc', '').encode('utf-8').decode( + 'utf-8') board.closed = json_obj['closed'] board.url = json_obj['url'] @@ -277,13 +278,13 @@ def get_members(self, filters=None): members = list() for obj in json_obj: m = Member(self.client, obj['id']) - m.status = obj.get('status', '').encode('utf-8') + m.status = obj.get('status', '').encode('utf-8').decode('utf-8') m.id = obj.get('id', '') m.bio = obj.get('bio', '') m.url = obj.get('url', '') - m.username = obj['username'].encode('utf-8') - m.full_name = obj['fullName'].encode('utf-8') - m.initials = obj.get('initials', '').encode('utf-8') + m.username = obj['username'].encode('utf-8').decode('utf-8') + m.full_name = obj['fullName'].encode('utf-8').decode('utf-8') + m.initials = obj.get('initials', '').encode('utf-8').decode('utf-8') members.append(m) return members diff --git a/trello/card.py b/trello/card.py index 827ef8a1..7dc0c410 100644 --- a/trello/card.py +++ b/trello/card.py @@ -104,7 +104,7 @@ def from_json(cls, parent, json_obj): raise Exception("key 'id' is not in json_obj") card = cls(parent, json_obj['id'], - name=json_obj['name'].encode('utf-8')) + name=json_obj['name'].encode('utf-8').decode('utf-8')) card.desc = json_obj.get('desc', '') card.closed = json_obj['closed'] card.url = json_obj['url'] @@ -127,7 +127,7 @@ def fetch(self, eager=True): '/cards/' + self.id, query_params={'badges': False}) self.id = json_obj['id'] - self.name = json_obj['name'].encode('utf-8') + self.name = json_obj['name'].encode('utf-8').decode('utf-8') self.desc = json_obj.get('desc', '') self.closed = json_obj['closed'] self.url = json_obj['url'] diff --git a/trello/label.py b/trello/label.py index 1010b993..a8066b06 100644 --- a/trello/label.py +++ b/trello/label.py @@ -22,7 +22,7 @@ def from_json(cls, board, json_obj): """ label = Label(board.client, label_id=json_obj['id'], - name=json_obj['name'].encode('utf-8'), + name=json_obj['name'].encode('utf-8').decode('utf-8'), color=json_obj['color']) return label @@ -36,6 +36,6 @@ def __repr__(self): def fetch(self): """Fetch all attributes for this label""" json_obj = self.client.fetch_json('/labels/' + self.id) - self.name = json_obj['name'].encode('utf-8') + self.name = json_obj['name'].encode('utf-8').decode('utf-8') self.color = json_obj['color'] return self diff --git a/trello/member.py b/trello/member.py index 2390005f..48648b26 100644 --- a/trello/member.py +++ b/trello/member.py @@ -60,9 +60,9 @@ def from_json(cls, trello_client, json_obj): :json_obj: the member json object """ - member = Member(trello_client, json_obj['id'], full_name=json_obj['fullName'].encode('utf-8')) - member.username = json_obj.get('username', '').encode('utf-8') - member.initials = json_obj.get('initials', '').encode('utf-8') + member = Member(trello_client, json_obj['id'], full_name=json_obj['fullName'].encode('utf-8').decode('utf-8')) + member.username = json_obj.get('username', '').encode('utf-8').decode('utf-8') + member.initials = json_obj.get('initials', '').encode('utf-8').decode('utf-8') # cannot close an organization # organization.closed = json_obj['closed'] return member diff --git a/trello/organization.py b/trello/organization.py index 279424f5..6c2192ca 100644 --- a/trello/organization.py +++ b/trello/organization.py @@ -22,8 +22,8 @@ def from_json(cls, trello_client, json_obj): :trello_client: the trello client :json_obj: the board json object """ - organization = Organization(trello_client, json_obj['id'], name=json_obj['name'].encode('utf-8')) - organization.description = json_obj.get('desc', '').encode('utf-8') + organization = Organization(trello_client, json_obj['id'], name=json_obj['name'].encode('utf-8').decode('utf-8')) + organization.description = json_obj.get('desc', '').encode('utf-8').decode('utf-8') # cannot close an organization # organization.closed = json_obj['closed'] organization.url = json_obj['url'] diff --git a/trello/trellolist.py b/trello/trellolist.py index 581b95f2..e18cd0c4 100644 --- a/trello/trellolist.py +++ b/trello/trellolist.py @@ -27,7 +27,7 @@ def from_json(cls, board, json_obj): :board: the board object that the list belongs to :json_obj: the json list object """ - list = List(board, json_obj['id'], name=json_obj['name'].encode('utf-8')) + list = List(board, json_obj['id'], name=json_obj['name'].encode('utf-8').decode('utf-8')) list.closed = json_obj['closed'] return list