promptflow icon indicating copy to clipboard operation
promptflow copied to clipboard

[BUG] [VSCode Extension] type 'python', exception 'charmap' codec can't decode byte 0x81 in position 98: character maps to <undefined>

Open Anbang-Hu opened this issue 3 years ago • 2 comments

Describe the bug If there is in python file, promptflow visual editor cannot decode it.

How To Reproduce the bug Steps to reproduce the behavior, how frequent can you experience the bug:

  1. Create a python node
from promptflow import tool

@tool
def prepare_data():
    return "https://www.bing.com/"
  1. Add the node to flow in visual editor
Generate tool meta of prepare_data.py error: Exception: Failed to generate tool meta for prepare_data.py: Reading meta file failed, path '.....\prepare_data.py', type 'python', exception 'charmap' codec can't decode byte 0x81 in position 98: character maps to <undefined>.

Screenshots NA

Environment Information

  • Promptflow Package Version using pf -v: 0.1.0b7.post1
  • Operating System: Windows 10
  • Python Version using python --version: Python 3.9.18
  • VS Code version. 1.82.1
  • Prompt Flow extension version. v1.0.12
  • On the VS Code bottom pane > Output pivot > "prompt flow" channel, find the error message could be relevant to the issue and past them here. That would be helpful for our trouble shooting.
  • If your code to repro the issue is public and you want to share us, please share the link.

Additional context NA

Anbang-Hu avatar Oct 12 '23 23:10 Anbang-Hu

Thanks for reporting! Fix PR has been merged.

huaiyan avatar Oct 13 '23 10:10 huaiyan

Another fix PR when we meet special character in PROMPT/LLM/CUSTOM_LLM tools. Can't read file will fail run execution.

huaiyan avatar Oct 16 '23 10:10 huaiyan