Find text I/O that relies on the default encoding

Proprietary

Python 3.15 uses UTF-8 as the default text encoding whatever the locale (PEP 686). Marks text-mode open(), io.open(), pathlib.Path.open(), read_text(), write_text(), io.TextIOWrapper(), and subprocess calls with text=True or universal_newlines=True that pass no encoding. Pass encoding="utf-8", or encoding="locale" to keep the previous behaviour. A call whose mode is not a literal is not reported.

org.openrewrite.python.migrate.FindImplicitTextEncoding
mod run . --recipe=org.openrewrite.python.migrate.FindImplicitTextEncoding

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.