fixed encoding errors, python 2 error message

encoding errors on non-utf8 systems should be fixed now
if the script is executed on python2, it should print an error message
to log now