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) .
This commit is contained in:
@@ -138,7 +138,7 @@ class BaseContent(object):
|
|||||||
data['index'] = None # This is filled in later by the method caller
|
data['index'] = None # This is filled in later by the method caller
|
||||||
|
|
||||||
if data['flair'] and not data['flair'].startswith('['):
|
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']
|
url_full = data['url_full']
|
||||||
if data['permalink'].split('/r/')[-1] == url_full.split('/r/')[-1]:
|
if data['permalink'].split('/r/')[-1] == url_full.split('/r/')[-1]:
|
||||||
|
|||||||
Reference in New Issue
Block a user