UP009 fix changes a file from UTF-8 to a different declared encoding #14704
Labels
bug
Something isn't working
help wanted
Contributions especially welcome
rule
Implementing or modifying a lint rule
The fix for
utf8-encoding-declaration
(UP009) in Ruff 0.8.1 changes the file’s declared encoding when the redundant UTF-8 encoding declaration is followed by a non-UTF-8 encoding declaration. In that case, the UTF-8 declaration is not completely redundant, because it blocks the following declaration from having an effect. The fix should insert up to 2 blank lines so the other declarations have no effect, or the fix should delete the other declarations, or the check should not report a violation.Example of a syntax error:
Example of changed behavior:
The text was updated successfully, but these errors were encountered: