Closed packetmagic closed 1 month ago
I was able to fix the issue by adding encoding='UTF-8' to the below function in print_style.py
def _log_html(self, html): with open(PrintStyle.log_file_path, "a", encoding='UTF-8') as f: # type: ignore f.write(html)
Implemented in print_style.py.
After getting data from perplexity it gets stuck in a loop and generates this error over and over.
{ "system_error": "Traceback (most recent call last): File "C:\Users\XXXXX\code\agent-zero\python\helpers\print_style.py", line 85, in _log_html f.write(html) File "C:\Program Files\Python311\Lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f422' in position 62: character maps to
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f422' in position 62: character maps to"
}