alpertunga-bile / prompt-generator-comfyui

Custom AI prompt generator node for the ComfyUI
MIT License
85 stars 8 forks source link

[BUG]UnicodeEncodeError: 'gbk' codec can't encode character '\u202c' #10

Closed ultimatech-cn closed 8 months ago

ultimatech-cn commented 8 months ago

Describe the bug When excuting the node, got encoding error.

Screenshots

ERROR:root:Traceback (most recent call last):
  File "E:\DEV\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "E:\DEV\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "E:\DEV\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "E:\DEV\ComfyUI_windows_portable\ComfyUI\custom_nodes\prompt-generator-comfyui\prompt_generator.py", line 290, in generate
    self.log_outputs(
  File "E:\DEV\ComfyUI_windows_portable\ComfyUI\custom_nodes\prompt-generator-comfyui\prompt_generator.py", line 130, in log_outputs
    file.write(
UnicodeEncodeError: 'gbk' codec can't encode character '\u202c' in position 196: illegal multibyte sequence

Operating System

Python Version

ultimatech-cn commented 8 months ago

Solved by myself. Just modifing the code line 120 with open(log_filename, "a", encoding='utf-8') as file: