Github Actions charmap issues generated by Rich #2

Closed
opened 2026-05-05 00:22:29 +00:00 by codeflash-ai · 4 comments
Owner
+------------- https://codeflash.ai/ -------------+
|                                                |
|               __    _____         __           |
|  _______  ___/ /__ / _/ /__ ____ / /           |
| / __/ _ \/ _  / -_) _/ / _ `(_-</ _ \          |
| \__/\___/\_,_/\__/_//_/\_,_/___/_//_/          |
|                                        v0.10.3 |
|                                                |
|                                                |
+------------------------------------------------+
INFO     Logging level set to INFO                                             
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Scripts\codeflash.exe\__main__.py", line 7, in <module>
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\main.py", line 21, in main
    args = parse_args()
           ^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\cli_cmds\cli.py", line 66, in parse_args
    return process_and_validate_cmd_args(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\cli_cmds\cli.py", line 74, in process_and_validate_cmd_args
    logging_config.set_level(logging.INFO, echo_setting=not is_init)
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\cli_cmds\logging_config.py", line 33, in set_level
    console.rule()
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line [15](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:16)85, in rule
    self.print(rule)
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line [16](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:17)78, in print
    with self:
         ^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 864, in __exit__
    self._exit_buffer()
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 822, in _exit_buffer
    self._check_buffer()
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 2019, in _check_buffer
    self._write_buffer()
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 2055, in _write_buffer
    legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\_windows_renderer.py", line [17](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:18), in legacy_windows_render
    term.write_styled(text, style)
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\_win32_console.py", line 441, in write_styled
    self.write_text(text)
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\_win32_console.py", line 402, in write_text
    self.write(text)
  File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\encodings\cp1252.py", line [19](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:20), 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>
Error: Process completed with exit code 1.

I assume it's related to rich presence / colored terminal prints?

``` +------------- https://codeflash.ai/ -------------+ | | | __ _____ __ | | _______ ___/ /__ / _/ /__ ____ / / | | / __/ _ \/ _ / -_) _/ / _ `(_-</ _ \ | | \__/\___/\_,_/\__/_//_/\_,_/___/_//_/ | | v0.10.3 | | | | | +------------------------------------------------+ INFO Logging level set to INFO Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Scripts\codeflash.exe\__main__.py", line 7, in <module> File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\main.py", line 21, in main args = parse_args() ^^^^^^^^^^^^ File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\cli_cmds\cli.py", line 66, in parse_args return process_and_validate_cmd_args(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\cli_cmds\cli.py", line 74, in process_and_validate_cmd_args logging_config.set_level(logging.INFO, echo_setting=not is_init) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\codeflash\cli_cmds\logging_config.py", line 33, in set_level console.rule() File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line [15](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:16)85, in rule self.print(rule) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line [16](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:17)78, in print with self: ^^^^ File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 864, in __exit__ self._exit_buffer() File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 822, in _exit_buffer self._check_buffer() File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 2019, in _check_buffer self._write_buffer() File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\console.py", line 2055, in _write_buffer legacy_windows_render(buffer, LegacyWindowsTerm(self.file)) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\_windows_renderer.py", line [17](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:18), in legacy_windows_render term.write_styled(text, style) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\_win32_console.py", line 441, in write_styled self.write_text(text) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\site-packages\rich\_win32_console.py", line 402, in write_text self.write(text) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\encodings\cp1252.py", line [19](https://github.com/NevermindNilas/TheAnimeScripter/actions/runs/13876446357/job/38829347511#step:5:20), 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> Error: Process completed with exit code 1. ``` I assume it's related to rich presence / colored terminal prints?
Author
Owner

Hey thanks for reporting!
We will try reproducing this issue.
I think a major cause is also that we don't have good testing on windows @KRRT7

Hey thanks for reporting! We will try reproducing this issue. I think a major cause is also that we don't have good testing on windows @KRRT7
Author
Owner

Thanks for the report, the issue here is with python and windows, specifically inside GHA windows runners, nothing to do with rich or codeflash.

The CI agent, for all OSes, actually executes the commands and redirects the output to a file, on windows, this results in the encoding being set to cp1252 which causes this error in the cp1252 encoder python uses, you can see more information here
setting the python IO encoding type i.e

env:
  PYTHONIOENCODING: "utf8"

should clear this error up for you

Thanks for the report, the issue here is with python and windows, specifically inside GHA windows runners, nothing to do with rich or codeflash. The CI agent, for all OSes, actually executes the commands and redirects the output to a file, on windows, this results in the encoding being set to `cp1252` which causes this error in the `cp1252` encoder python uses, you can see more information [here]( https://gist.github.com/NodeJSmith/e7e37f2d3f162456869f015f842bcf15) setting the python IO encoding type i.e ```yaml env: PYTHONIOENCODING: "utf8" ``` should clear this error up for you
Author
Owner

Sounds good, will test in a minute and come back

Sounds good, will test in a minute and come back
Author
Owner

Forgot to come back, @KRRT7 was right. Going to close this issue now. Thanks!

Forgot to come back, @KRRT7 was right. Going to close this issue now. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: codeflash-ai/codeflash#2
No description provided.