UnicodeEncodeError when writing to a file,write(s.encode('latin-1'))