Skip to content
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

Rule A003 cause panic #11641

Closed
qarmin opened this issue May 31, 2024 · 2 comments · Fixed by #11645
Closed

Rule A003 cause panic #11641

qarmin opened this issue May 31, 2024 · 2 comments · Fixed by #11645
Assignees
Labels
bug Something isn't working fuzzer Surfaced via fuzzing.

Comments

@qarmin
Copy link

qarmin commented May 31, 2024

ruff 0.4.6 (latest changes from main branch)

ruff  *.py --select A003 --no-cache --fix --unsafe-fixes --preview --output-format concise --isolated

file content:


 mp} assertot yt
s
__init__ impz

error

All checks passed!

error: Panicked while linting /home/rafal/test/tmp_folder/15358500963919727445.py: This indicates a bug in Ruff. If you could open an issue at:

    https://github.com/astral-sh/ruff/issues/new?title=%5BLinter%20panic%5D

...with the relevant file contents, the `pyproject.toml` settings, and the following stack trace, we'd be very appreciative!

panicked at crates/ruff_python_codegen/src/stylist.rs:112:51:
byte index 1 is not a char boundary; it is inside '\u{a0}' (bytes 0..2) of ` mp} assertot yt`
Backtrace:    0: ruff::panic::catch_unwind::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::str::slice_error_fail_rt
   7: core::str::slice_error_fail
   8: ruff_python_codegen::stylist::Stylist::from_tokens
   9: ruff_linter::linter::lint_fix
  10: ruff::diagnostics::lint_path
  11: ruff::commands::check::lint_path
  12: rayon::iter::plumbing::Producer::fold_with
  13: rayon::iter::plumbing::bridge_producer_consumer::helper
  14: ruff::commands::check::check
  15: ruff::check
  16: ruff::run
  17: ruff::main
  18: std::sys_common::backtrace::__rust_begin_short_backtrace
  19: std::rt::lang_start::{{closure}}
  20: std::rt::lang_start_internal
  21: main
  22: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  23: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:360:3
  24: _start

python_compressed.zip

@MichaReiser MichaReiser added the bug Something isn't working label May 31, 2024
@MichaReiser
Copy link
Member

Hmm, I don't see anything obvious here that's triggering this but certainly worth looking into. @charliermarsh you merged a PR for this yesterday.

@charliermarsh charliermarsh self-assigned this May 31, 2024
@charliermarsh
Copy link
Member

I can take it.

@charliermarsh charliermarsh added the fuzzer Surfaced via fuzzing. label May 31, 2024
charliermarsh added a commit that referenced this issue May 31, 2024
## Summary

A beginner's mistake :)

Closes #11641.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fuzzer Surfaced via fuzzing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants