Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught UnicodeEncodeError in cp1252.py line 19 #1281

Closed
EthanVV opened this issue Sep 1, 2024 · 2 comments
Closed

Uncaught UnicodeEncodeError in cp1252.py line 19 #1281

EthanVV opened this issue Sep 1, 2024 · 2 comments

Comments

@EthanVV
Copy link

EthanVV commented Sep 1, 2024

Aider version: 0.54.8
Python version: 3.12.5
Platform: Windows-11-10.0.22631-SP0
Python implementation: CPython
Virtual environment: No
OS: Windows 11 (64bit)
Git version: git version 2.42.0.windows.2

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 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 680, in main
    coder.run()
  File "base_coder.py", line 727, in run
    user_message = self.get_input()
                   ^^^^^^^^^^^^^^^^
  File "base_coder.py", line 740, in get_input
    return self.io.get_input(
           ^^^^^^^^^^^^^^^^^^
  File "io.py", line 270, in get_input
    self.console.rule(**style)
  File "console.py", line 1590, in rule
    self.print(rule)
  File "console.py", line 1683, in print
    with self:
  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 2024, in _check_buffer
    self._write_buffer()
  File "console.py", line 2060, 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 442, in write_styled
    self.write_text(text)
  File "_win32_console.py", line 403, in write_text
    self.write(text)
  File "cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-78: character maps to <undefined>

@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and 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, let me know if it works better for you.

@karcheng
Copy link

karcheng commented Nov 9, 2024

i ran python.exe -m pip install --upgrade --upgrade-strategy only-if-needed git+https://github.com/Aider-AI/aider.git

result of the update:
Successfully installed aider-chat-0.62.2.dev70+g52c49fc8 aiohttp-3.10.10 annotated-types-0.7.0 anyio-4.6.2.post1 attrs-24.2.0 certifi-2024.8.30 cffi-1.17.1 charset-normalizer-3.4.0 distro-1.9.0 filelock-3.16.1 frozenlist-1.5.0 fsspec-2024.10.0 httpcore-1.0.6 httpx-0.27.2 huggingface-hub-0.26.2 idna-3.10 markupsafe-3.0.2 multidict-6.1.0 openai-1.53.0 packaging-24.1 pycparser-2.22 pydantic-2.9.2 pydantic-core-2.23.4 pyyaml-6.0.2 regex-2024.9.11 sniffio-1.3.1 tqdm-4.66.6 typing-extensions-4.12.2 urllib3-2.2.3 yarl-1.17.1

I then ran aider --show-repo-map > repo-map.md

this is the stack trace:
Aider version: 0.62.2.dev70+g52c49fc8
Python version: 3.12.2
Platform: Windows-11-10.0.26120-SP0
Python implementation: CPython
Virtual environment: No
OS: Windows 11 (64bit)
Git version: git version 2.41.0.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 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 760, in main
    io.tool_output(repo_map)
  File "io.py", line 668, in tool_output
    self.console.print(*messages, style=style)
  File "console.py", line 1678, in print
    with self:
  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 19, in legacy_windows_render
    term.write_text(text)
  File "_win32_console.py", line 402, in write_text
    self.write(text)
  File "cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u22ee' in position 0: character maps to <undefined>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants