Skip to content

Module 'stat' has no attribute 'filemode' #1836

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
yurikhan opened this issue Jan 20, 2018 · 1 comment
Closed

Module 'stat' has no attribute 'filemode' #1836

yurikhan opened this issue Jan 20, 2018 · 1 comment

Comments

@yurikhan
Copy link
Contributor

from stat import filemode
$ mypy test1.py
test1.py:1: error: Module 'stat' has no attribute 'filemode'

Looking in my copy of typeshed/stdlib, I see that 3/stat.pyi does not contain a stub for filemode. 3.4/_stat.pyi does, but mypy does not see it there.

What is the right way to deal with that?

@yurikhan yurikhan changed the title Module stat has no attribute filemode Module 'stat' has no attribute 'filemode' Jan 20, 2018
@gvanrossum
Copy link
Member

You can submit a PR that adds something like this

if sys.version_info >= (3, 3):
    def filemode...

yurikhan added a commit to yurikhan/typeshed that referenced this issue Jan 20, 2018
JelleZijlstra pushed a commit that referenced this issue Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants