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

test_pathobject fails with IsADirectoryError fsspec 0.8.3 #432

Closed
tricktron opened this issue Oct 3, 2020 · 1 comment · Fixed by #437
Closed

test_pathobject fails with IsADirectoryError fsspec 0.8.3 #432

tricktron opened this issue Oct 3, 2020 · 1 comment · Fixed by #437

Comments

@tricktron
Copy link

When running all tests on our linux remote server the test test_pathobject fails with:

def test_pathobject():
        import pathlib
    
        here = os.path.abspath(os.path.dirname(__file__))
        flist = os.listdir(here)
        plist_str = [os.path.join(here, p) for p in flist]
        plist = [pathlib.Path(p) for p in plist_str]
        of = open_files(plist)
        assert len(of) == len(flist)
        assert [f.path for f in of] == plist_str
    
        of = open_files(plist[0])
        assert len(of) == 1
        assert of[0].path == plist_str[0]
>       with of[0] as f:

fsspec/tests/test_core.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
fsspec/core.py:102: in __enter__
    f = self.fs.open(self.path, mode=mode)
fsspec/spec.py:892: in open
    **kwargs
fsspec/implementations/local.py:115: in _open
    return LocalFileOpener(path, mode, fs=self, **kwargs)
fsspec/implementations/local.py:197: in __init__
    self._open()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fsspec.implementations.local.LocalFileOpener object at 0x7ffff69a9b90>

    def _open(self):
        if self.f is None or self.f.closed:
            if self.autocommit or "w" not in self.mode:
>               self.f = open(self.path, mode=self.mode)
E               IsADirectoryError: [Errno 21] Is a directory: '/build/source/fsspec/tests/__pycache__'

fsspec/implementations/local.py:202: IsADirectoryError

If I run it locally on a OSX and linux popOS machine and on a remote OSX builder all tests pass. So I cannot reproduce it locally. This is strange as usually the linux builder passes all tests and the OSX fails😃.

Do you know what may cause this test to fail?

@martindurant
Copy link
Member

Clearly should not rely on the state of the local directory... but should use a temp directory like all the other tests!

tricktron pushed a commit to tricktron/nixpkgs that referenced this issue Oct 7, 2020
Disables flaky test. Has been resolved in fsspec/filesystem_spec#432 and
can thus be enabled again starting from version `0.8.4`.
tricktron pushed a commit to tricktron/nixpkgs that referenced this issue Oct 10, 2020
Disables flaky test. Has been resolved in fsspec/filesystem_spec#432 and
can thus be enabled again starting from version `0.8.4`.

(cherry picked from commit 0a9641b)
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

Successfully merging a pull request may close this issue.

2 participants