Skip to content

Invalid aiofiles stubs #4714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MKuranowski opened this issue Oct 25, 2020 · 1 comment · Fixed by #4734
Closed

Invalid aiofiles stubs #4714

MKuranowski opened this issue Oct 25, 2020 · 1 comment · Fixed by #4734
Labels
stubs: false positive Type checkers report false errors

Comments

@MKuranowski
Copy link
Contributor

Even after PR #4650, the stubs for aiofiles are incorrect.

The stubs still don't include wrapped methods for AsyncBufferedReader, AsyncBufferedIOBase, AsyncBufferedReader and AsyncFileIO. Something like this doesn't type check, since, according to current stubs, AsyncBufferedReader has no read method:

import aiofiles

async def print_file(path: str) -> None:
    async with aiofiles.open(path, mode="r") as f:
        print(await f.read())

And also, there's no aiofiles._os module, it should be aiofiles.os.

@srittau srittau added the stubs: false positive Type checkers report false errors label Oct 27, 2020
@srittau
Copy link
Collaborator

srittau commented Oct 27, 2020

Any PRs welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants