Skip to content

Feature request: PLW1514 autofix #8883

@Avasam

Description

@Avasam

Can an autofix be created for the preview rule PLW1514 ? Even if it's "unsafe". Updating hundreds of instances manually is quite tedious.

In Python 3.10+ this would autofix to encoding="locale", in Python <=3.9 this would autofix to encoding=locale.getpreferredencoding(False) (see: https://peps.python.org/pep-0597/). Search & replacing those if I want a specific encoding is easier. An option to specify prefered encoding can also be set (which could even be re-used by a new rule that ensures consistent encoding is used with desired value, like "utf-8")

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions