Skip to content
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

Instance of 'OpenFiles' has no 'path' member (no-member) #1678

Open
mxmlnkn opened this issue Sep 18, 2024 · 1 comment
Open

Instance of 'OpenFiles' has no 'path' member (no-member) #1678

mxmlnkn opened this issue Sep 18, 2024 · 1 comment

Comments

@mxmlnkn
Copy link
Contributor

mxmlnkn commented Sep 18, 2024

Hi,

I'm trying to use fsspec, but I cannot convince pylint of the correctness of my program:

import fsspec
file = fsspec.open("foo")
print(file.path)

Calling pylint test.py yields:

test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:4:6: E1101: Instance of 'OpenFiles' has no 'path' member (no-member)

For some reason, pylint seems to think that open returns OpenFiles, but it actually returns OpenFile. Could it be that the type information is somehow incorrect? The program runs fine, so it definitely is a false positive.

@martindurant
Copy link
Member

Could it be that the type information is somehow incorrect?

Certainly can be. In fact, the function is not typed. It returns fsspec.open_files(...)[0], i.e., OpenFiles[0]. getitem on OpenFiles can return OpenFiles for a slice, or a single OpenFile for an integer. Make of that what you like.

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