python-trio / flake8-async

Highly opinionated linter for Trio code
https://flake8-async.readthedocs.io
MIT License
17 stars 2 forks source link

Add TRIO23x, sync IO call in async function #101

Closed jakkdl closed 1 year ago

jakkdl commented 1 year ago

First bullet point of #58

Use trio.open_file() instead of open(), io.open, io.open_code, or os.fdopen in async functions

Although I guessed that os.fdopen should be wrapped in trio.wrap_file as per the intro

I have no idea how to stop shed/pyupgrade from reformatting io.open into open, tried both #fmt: off and #noqa.