perryhuynh / kcauto

kcauto, the successor to kancolle-auto, a Kantai Collection (Kancolle) bot/automation tool
GNU General Public License v3.0
68 stars 22 forks source link

GUI and unicode error #440

Closed kenahamtan closed 4 years ago

kenahamtan commented 4 years ago

Please make sure you are on the latest version of kcauto, and that there is not already a ticket open for your issue.

Please remove sections of this template you do not find relevant when creating your ticket.

Environment details

Issue variability

Is the issue consistent (can be reproduced consistently) or is it intermittent (only happens sometimes)?: consistent

Issue

GUI mode has this error. No problem running command line.

Log

[2020-04-09 17:51:26] kcauto has been running for 0d 0h 0m 18s (loop 1).
[2020-04-09 17:51:26] 0 Expeditions sent (0.00/hr) / 0 Expeditions received (0.00/hr)
[2020-04-09 17:51:26] Fleet 2 / On expedition / Returning at 2020-04-09 18:04:22
[2020-04-09 17:51:26] Fleet 3 / On expedition / Returning at 2020-04-09 19:15:45
[2020-04-09 17:51:26] Fleet 4 / On expedition / Returning at 2020-04-09 18:14:40
[2020-04-09 17:51:26] Active Scheduler rules:
[2020-04-09 17:51:26] - Stop kcauto. at 2020-04-10 01:12:07
Traceback (most recent call last):
  File "C:\Users\Milamber\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Milamber\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "kcauto\__main__.py", line 19, in <module>
    kcauto_main()
  File "kcauto\kcauto_wrapper.py", line 40, in kcauto_main
    _.kcauto.print_stats()
  File "kcauto\kcauto.py", line 200, in print_stats
    sts.stats.print_stats()
  File "kcauto\stats\stats_core.py", line 103, in print_stats
    Log.log_success(self.rsc)
  File "kcauto\util\logger.py", line 47, in log_success
    flush=True)
  File "C:\Users\Milamber\AppData\Local\Programs\Python\Python37\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0394' in position 40: character maps to <undefined>
[2020-04-09 17:51:26] Terminated kcauto subprocess via GUI.

Config

[insert relevant config sections here; remove section if irrelevant]
perryhuynh commented 4 years ago

Did you run set PYTHONIOENCODING=utf-8 in the command line before starting the GUI? You have to run it every time you open a new command line unless you set it permanently.