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

Avoid syntax error via invalid ur string prefix #8971

Merged
merged 1 commit into from
Dec 2, 2023
Merged

Conversation

charliermarsh
Copy link
Member

Summary

If a string has a Unicode prefix, we can't add the r prefix on top of that -- we need to remove and replace it. (The Unicode prefix is redundant anyway in Python 3.)

Closes #8967.

@charliermarsh charliermarsh added the bug Something isn't working label Dec 2, 2023
@@ -31,7 +31,6 @@ mod tests {
#[test_case(Rule::BlankLineWithWhitespace, Path::new("W29.py"))]
#[test_case(Rule::InvalidEscapeSequence, Path::new("W605_0.py"))]
#[test_case(Rule::InvalidEscapeSequence, Path::new("W605_1.py"))]
#[test_case(Rule::InvalidEscapeSequence, Path::new("W605_2.py"))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted W605_1.py which looks identical to W605_0.py? And then renamed W605_2.py to W605_1.py.

@charliermarsh charliermarsh merged commit 1dda669 into main Dec 2, 2023
16 checks passed
@charliermarsh charliermarsh deleted the charlie/unicode branch December 2, 2023 18:37
Copy link
Contributor

github-actions bot commented Dec 2, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

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

Successfully merging this pull request may close these issues.

[Fix error] UP025, UP032, W605
1 participant