2

I get an error: UnicodeEncodeError: 'charmap' codec can't encode character '\u2264' in position 0: character maps to when the pycodestyle check_files hits this line:

worksheet1.write_formula('E' + str(i), '=IF(F' + str(i) + '>G' + str(i) + ',"↑",IF(F' + str(i) + '=G' + str(i) + ',"↔","↓"))', arrows_format)

How can I keep using the Unicode and use the pycodestyle checker? (I'm assuming it's the arrow characters that cause the error)

This seems important: To capture the pycodestyle output (print) I use :

sys.stdout = open(ReportPath, 'w')

and save the 'print' output to a file. I think this is important because the 'print()' that pycodestyle tries does not actually happen.

Mattman85208
  • 1,858
  • 2
  • 29
  • 51
  • It sounds like printing is indeed the problem - you probably need to ensure the console can handle unicode - https://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console?answertab=votes#tab-top – snakecharmerb Nov 02 '19 at 07:59

0 Answers0