vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

[Bug] An error will be thrown when the initial line of the file is a Chinese comment(SyntaxError: Non-ASCII character '\xe7')

Open zhchen6688 opened this issue 1 year ago • 3 comments

  • VS Code Version: Version: 1.89.1 (Universal)
  • OS Version: 13.3 (22E252)
  • Code Runner Version: Code Runner v0.12.2

Describe the bug Description of what the bug is. An error will be thrown when the initial line of the file is a Chinese comment in run code model.

To Reproduce Steps to reproduce the behavior:

  1. create a python (a.py)file and inputs some chinese commens using """ """ style
  2. click vscode run button

Actual behavior xxx line 2 SyntaxError: Non-ASCII character '\xe7' in file a.py

Expected behavior Description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

zhchen6688 avatar May 21 '24 03:05 zhchen6688

  1. The error will disappear when you disable Code Runner plugin.
  2. If you do not use the RUN CODE function, you will not get an error.

zhchen6688 avatar May 21 '24 03:05 zhchen6688

Python version is 3.12

zhchen6688 avatar May 21 '24 03:05 zhchen6688

python 3.12,code runner版本和你一样,没有成功复现的问题。 无论是

"""中文"""
print("中文")

还是

# 注释
"""中文"""
print("中文")

都可以正常运行。

Muyu-Chen avatar Jan 12 '25 03:01 Muyu-Chen