I'm rather new at Python and am experiencing some issues printing the contents of an Exception:
# -*- coding: ISO-8859-1 -*-
except Exception as err:
print(err)
yields "UnicodeEncodeError: 'ascii' codec can't encode character u'\uf260' in position 52: ordinal not in range(128)"
I've tried reading https://docs.python.org/2.7/howto/unicode.html#the-unicode-type but the issue I'm encountering is that in order to decode and encode or use unicode(..,errors='ignore') I need a string and str(err) fails with the above error message.
This is in a Windows environ. Thankful for any replies, even if it is "learn to search!" because in that case there was indeed a similar question that I missed while searching that's hopefully been answered : )
Edit. I've tried
print("Error {0}".format(str(err.args[0])).encode('utf-8', errors='ignore'))
which yields exactly the same error message.