alexdelorenzo / aiopath

📁 Asynchronous pathlib for Python
https://alexdelorenzo.dev
GNU Lesser General Public License v3.0
162 stars 6 forks source link

Incorrect types when using binary file mode #36

Open FichteFoll opened 2 months ago

FichteFoll commented 2 months ago

When opening a file with binary file mode, this is not reflected in the .read and .write methods.

Example:

async def _store_file(path: AsyncPath, content: bytes):
    async with path.open("wb") as fp:
        s = await fp.read()
        reveal_type(s)
        await fp.write(content)

2024-08-26_16-50-32 2024-08-26_16-50-54