Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

[Bug]: UnicodeDecodeError when running `create_better_frame pattern` on Windows 10

Open Gerkinfeltser opened this issue 1 year ago • 1 comments

What happened?

Hello team!

I've encountered a minor issue when attempting to use the create_better_frame fabric pattern on my Windows 10 machine. Below are the steps I took and the resulting error message:

  1. I ran the following command in PowerShell: echo "I'm great!" | fabric -p create_better_frame
  2. Upon execution, fabric produced the traceback and error contained in the "Relevant log output" section of this issue.

I suspect that this error may be related to the presence of emojis in the essay the pattern contains. Again, very minor but I thought I'd let you know! (I'm also not confident enough with github to branch, fix & pull yet! 😛)

Thank you!

Version check

  • [X] Yes I was.

Relevant log output

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:\Users\XXX\.local\bin\fabric.exe\__main__.py", line 7, in <module>
  File "C:\Users\XXX\AppData\Local\pipx\pipx\venvs\fabric\Lib\site-packages\installer\client\cli\fabric.py", line 207, in main
    standalone.sendMessage(text)
  File "C:\Users\XXX\AppData\Local\pipx\pipx\venvs\fabric\Lib\site-packages\installer\client\cli\utils.py", line 342, in sendMessage
    system = f.read()
             ^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 6423: character maps to <undefined>

Relevant screenshots (optional)

No response

Gerkinfeltser avatar May 24 '24 20:05 Gerkinfeltser

I had similar issue with improve prompt (python 3.12) When I set explicitly UTF-8 on line 332 cli\utils.py with open(wisdom_File, encoding="utf8", mode="r") as f: I'm able to run the command.

foxbg avatar Jun 06 '24 00:06 foxbg