From 466af862b321908e0251c90ffed76643fa009352 Mon Sep 17 00:00:00 2001 From: Marc Antonio Queiroz Date: Mon, 26 Oct 2015 14:48:19 -0200 Subject: [PATCH] After update to version 1.6.1 a Unicode error start to happen. Any SUBREDDIT with special characters like u'\xe3' are trigging an error at line 141, data['flair'] = '[{}]'.format(data['flair'].strip()) . The solution was to add u'[{}]' to the string. The original error message: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 7: ordinal not in range(128) . --- rtv/content.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtv/content.py b/rtv/content.py index c693858..6fdce6a 100644 --- a/rtv/content.py +++ b/rtv/content.py @@ -138,7 +138,7 @@ class BaseContent(object): data['index'] = None # This is filled in later by the method caller if data['flair'] and not data['flair'].startswith('['): - data['flair'] = '[{}]'.format(data['flair'].strip()) + data['flair'] = u'[{}]'.format(data['flair'].strip()) url_full = data['url_full'] if data['permalink'].split('/r/')[-1] == url_full.split('/r/')[-1]: