Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
22.66k stars 2.11k forks source link

Uncaught UnicodeEncodeError in _win32_console.py line 402 #2494

Open pinewaves8 opened 1 day ago

pinewaves8 commented 1 day ago

Aider version: 0.62.1 Python version: 3.9.20 Platform: Windows-10-10.0.22631-SP0 Python implementation: CPython Virtual environment: No OS: Windows 10 (64bit) Git version: git version 2.44.0.windows.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "__main__.py", line 7, in <module>
    sys.exit(main())
  File "main.py", line 802, in main
    coder.run(with_message=args.message)
  File "base_coder.py", line 732, in run
    self.run_one(with_message, preproc)
  File "base_coder.py", line 781, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1289, in send_message
    lint_errors = self.lint_edited(edited)
  File "base_coder.py", line 1394, in lint_edited
    self.io.tool_warning(res)
  File "io.py", line 639, in tool_warning
    self._tool_message(message, strip, self.tool_warning_color)
  File "io.py", line 632, in _tool_message
    self.console.print(message, **style)
  File "console.py", line 1726, in print
    self._buffer.extend(new_segments)
  File "console.py", line 864, in __exit__
    self._exit_buffer()
  File "console.py", line 822, in _exit_buffer
    self._check_buffer()
  File "console.py", line 2019, in _check_buffer
    self._write_buffer()
  File "console.py", line 2055, in _write_buffer
    legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
  File "_windows_renderer.py", line 17, in legacy_windows_render
    term.write_styled(text, style)
  File "_win32_console.py", line 441, in write_styled
    self.write_text(text)
  File "_win32_console.py", line 402, in write_text
    self.write(text)
UnicodeEncodeError: 'gbk' codec can't encode character '\u22ee' in position 3: illegal multibyte sequence
pinewaves8 commented 1 day ago

I used aider --model ollama_chat/qwen2.5-coder:1.5b to code a file and encountered the above problem.