-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Panic] byte index 2 is not a char boundary #9145
Labels
bug
Something isn't working
Comments
What's the command you're running? Is it |
not running any command, it's like an auto-check (not manually triggering formatting), so I assume it's similar to running |
@MichaReiser I think the bug is for both
|
dhruvmanila
pushed a commit
that referenced
this issue
Dec 15, 2023
The example below used to panic because we tried to split at 2 bytes in the 4-bytes character `转`. ```python def sample_func(xx): """ 转置 (transpose) """ return xx.T ``` Fixes #9145 Fixes astral-sh/ruff-vscode#362 The second commit is a small test refactoring.
charliermarsh
pushed a commit
that referenced
this issue
Dec 19, 2023
We've had bugs related to non-latin scripts, most recently #9145, where just starting a docstring with multi-byte characters would panic. I've added https://github.com/binary-husky/gpt_academic to catch those in the ecosystem checks, it's a popular repo with mixed english and chinese comments and symbols.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using
v2023.56.0
and1.85.1
in win10.Seems a line inside docstring that starts with a Chinese character would cause this.
In jupyter notebook I create a function:
the error logs:
The text was updated successfully, but these errors were encountered: