Skip to content

Uncaught UnicodeEncodeError in console.py line 2107 #4665

@davdunc

Description

@davdunc

Aider version: 0.86.1
Python version: 3.11.2
Platform: Linux-6.12.47+rpt-rpi-2712-aarch64-with-glibc2.36
Python implementation: CPython
Virtual environment: Yes
OS: Linux 6.12.47+rpt-rpi-2712 (64bit)
Git version: git version 2.39.5

An uncaught exception occurred:

Traceback (most recent call last):
  File "io.py", line 980, in _tool_message
    self.console.print(message, **style)
  File "console.py", line 1697, in print
    with self:
  File "console.py", line 870, in __exit__
    self._exit_buffer()
  File "console.py", line 826, in _exit_buffer
    self._check_buffer()
  File "console.py", line 2038, in _check_buffer
    self._write_buffer()
  File "console.py", line 2107, in _write_buffer
    self.file.write(text)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2588' in position 315: ordinal not in range(256)
*** You may need to add PYTHONIOENCODING=utf-8 to your environment ***

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 1162, in main
    coder.run()
  File "base_coder.py", line 887, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 934, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1600, in send_message
    lint_errors = self.lint_edited(edited)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1694, in lint_edited
    self.io.tool_warning(res)
  File "io.py", line 993, in tool_warning
    self._tool_message(message, strip, self.tool_warning_color)
  File "io.py", line 986, in _tool_message
    self.console.print(message, **style)
  File "console.py", line 1697, in print
    with self:
  File "console.py", line 870, in __exit__
    self._exit_buffer()
  File "console.py", line 826, in _exit_buffer
    self._check_buffer()
  File "console.py", line 2038, in _check_buffer
    self._write_buffer()
  File "console.py", line 2107, in _write_buffer
    self.file.write(text)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2588' in position 315: ordinal not in range(256)
*** You may need to add PYTHONIOENCODING=utf-8 to your environment ***

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions