From 3bbd3685d80117b70aa683f52f7fc13523cfc321 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 7 Sep 2014 22:26:07 +0200 Subject: [PATCH] fix bug #787 --- plugins/labels.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/labels.py b/plugins/labels.py index 57f63a372..73f0bb39b 100644 --- a/plugins/labels.py +++ b/plugins/labels.py @@ -177,8 +177,17 @@ class Plugin(BasePlugin): try: bundle = {"labels": {}} for key, value in self.wallet.labels.iteritems(): - encoded = self.encode(key) - bundle["labels"][encoded] = self.encode(value) + try: + encoded_key = self.encode(key) + except: + print_error('cannot encode', encoded_key) + continue + try: + encoded_value = self.encode(value) + except: + print_error('cannot encode', encoded_value) + continue + bundle["labels"][encoded_key] = encoded_value params = json.dumps(bundle) connection = httplib.HTTPConnection(self.target_host)