4👍
✅
I replaced it with this dummy function that apply unicode(x).encode("utf-8")
if the string is unicode, and convert it to str
if it’s a number:
def smart_str(x):
if isinstance(x, unicode):
return unicode(x).encode("utf-8")
elif isinstance(x, int) or isinstance(x, float):
return str(x)
return x
Source:stackexchange.com