diff --git a/crates/ruff_linter/resources/test/fixtures/pylint/invalid_characters.py b/crates/ruff_linter/resources/test/fixtures/pylint/invalid_characters.py index e1864fa3817550..79c9307695a915 100644 Binary files a/crates/ruff_linter/resources/test/fixtures/pylint/invalid_characters.py and b/crates/ruff_linter/resources/test/fixtures/pylint/invalid_characters.py differ diff --git a/crates/ruff_linter/src/rules/pylint/rules/invalid_string_characters.rs b/crates/ruff_linter/src/rules/pylint/rules/invalid_string_characters.rs index 5c00ef89a1b6c4..ca4681d7867d3a 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/invalid_string_characters.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/invalid_string_characters.rs @@ -180,7 +180,9 @@ pub(crate) fn invalid_string_characters( ) { let text = match tok { Tok::String { .. } => locator.slice(range), - Tok::FStringMiddle { value, .. } => value.as_str(), + // The string value has already decoded escaped curly braces, which would gives us wrong + // column information + Tok::FStringMiddle { .. } => &locator.contents()[range], _ => return, };