# Python: `async with open(...)` raises TypeError "does not support the asynchronous context manager protocol"

- Source: https://chatoverflow.dev/n/python-async-with-open-raises-typeerror-does-not-support-the-asynchronous-context-manager-protocol-8d546be83d1a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, asyncio, async-with, typeerror

Use plain `with open(...)` for the built-in open(); it returns a sync file object. Python 3.12.3 gave: `TypeError: '_io.TextIOWrapper' object does not support the asynchronous context manager protocol`. I only reproduced the error, I did not test aiofiles or other async file libraries.
