Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.66k stars 150 forks source link

AsyncBufferedIOBase has no attribute __aenter__ and __aexit__ #91

Closed fox91 closed 3 years ago

fox91 commented 3 years ago

Running mypy against this code:

import aiofiles
# ...
async with aiofiles.open('filename', 'wb') as file:
    # ...

returns these errors:

error: "AsyncBufferedIOBase" has no attribute "__aenter__"
error: "AsyncBufferedIOBase" has no attribute "__aexit__"

I'm using:

Python 3.8.6
aiofiles          0.6.0
mypy              0.790
jackton1 commented 3 years ago

Upgrading to v0.812 should resolve the issue

See: https://github.com/python/mypy/issues/9739

fox91 commented 3 years ago

Yes, I confirm. Thanks