ruff
23364ae6 - [`pyupgrade`] Fix panic caused by handling of octals in `UP012` (#24390)

Commit
5 days ago
[`pyupgrade`] Fix panic caused by handling of octals in `UP012` (#24390) This fixes two errors introduced by #16058 : - An off-by-one error caused a panic when `UP012` was run on strings ending in an octal (and could also cause the rule to trigger when it should not, e.g. for `"\000\N{DIGIT ONE}"`). - When checking that an octal `\abc` was not larger than `\377`, it was parsed using `"abc".parse::<u8>()`. But this uses base 10. We need to use `u8::from_str_radix("abc",8)` instead. Closes #24389
Author
Parents
Loading