-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
help wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
EM101 currently doesn't flag errors that have byte strings, despite them still causing a duplicate message playground
PS ~\Desktop\New_folder>Get-Content issue.py
raise RuntimeError(b"error message") # no error
raise RuntimeError("error message") # EM101PS ~\Desktop\New_folder>uvx ruff check issue.py --select EM
issue.py:2:20: EM101 Exception must not use a string literal, assign to variable first
|
1 | raise RuntimeError(b"error message") # no error
2 | raise RuntimeError("error message") # EM101
| ^^^^^^^^^^^^^^^ EM101
|
= help: Assign to variable; remove string literal
Found 1 error.
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
PS ~\Desktop\New_folder>py issue.py
Traceback (most recent call last):
File "~\Desktop\New_folder\issue.py", line 1, in <module>
raise RuntimeError(b"error message") # no error
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: b'error message'
A github search for raise RuntimeError(b" gives a decent number of results, so this is not unheard of.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule