aider icon indicating copy to clipboard operation
aider copied to clipboard

Uncaught UnicodeEncodeError in cp1252.py line 19

Open mindful-time opened this issue 1 year ago • 1 comments

Aider version: 0.56.0 Python version: 3.11.3 Platform: Windows-10-10.0.19045-SP0 Python implementation: CPython Virtual environment: Yes OS: Windows 10 (64bit) Git version: git version 2.40.1.windows.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "__main__.py", line 4, in <module>
    main()
  File "main.py", line 675, in main
    coder.run(with_message=args.message)
  File "base_coder.py", line 729, in run
    self.run_one(with_message, preproc)
  File "base_coder.py", line 778, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1102, in send_message
    chunks = self.format_messages()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1040, in format_messages
    chunks = self.format_chat_chunks()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 990, in format_chat_chunks
    chunks.repo = self.get_repo_messages()
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 632, in get_repo_messages
    repo_content = self.get_repo_map()
                   ^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 604, in get_repo_map
    repo_content = self.repo_map.get_repo_map(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 127, in get_repo_map
    files_listing = self.get_ranked_tags_map(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 478, in get_ranked_tags_map
    result = self.get_ranked_tags_map_uncached(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 509, in get_ranked_tags_map_uncached
    ranked_tags = self.get_ranked_tags(
                  ^^^^^^^^^^^^^^^^^^^^^
  File "repomap.py", line 407, in get_ranked_tags
    progress()
  File "utils.py", line 278, in step
    self._step()
  File "utils.py", line 287, in _step
    print(f"\r{self.text} {next(self.spinner_chars)}\r{self.text} ", end="", flush=True)
  File "cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u280b' in position 19: character maps to <undefined>

mindful-time avatar Sep 15 '24 18:09 mindful-time

Thank you for filing this issue.

The fix is available in the main branch. You can get it by installing the latest version from GitHub:

aider --install-main-branch

# or

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, please report if it works better for you.

fry69 avatar Sep 15 '24 18:09 fry69

This looks like a duplicate of #1281, so I'm going to close it so discussion can happen there. Please let me know if you think it's actually a distinct issue.

paul-gauthier avatar Sep 20 '24 18:09 paul-gauthier