You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest release, the MemoryFileSystem started to raise an error in mkdir if the target directory already exists as a directory. I think this changed in #654, and it might also have been a deliberate change. But it is inconsistent how the local filesystem works.
LocalFileSystem: works to create existing directory but fails if it already exists as a file:
fromfsspec.implementations.localimportLocalFileSystemasFSSpecLocalFileSystemfs=FSSpecLocalFileSystem()
fs.mkdir("test_dir")
fs.touch("test_file")
# creating an existing dir is fine>>>fs.mkdir("test_dir")
# creating a dir that already exists as a file errors>>>fs.mkdir("test_file")
...
FileExistsError: [Errno17] Fileexists: '/home/joris/scipy/test_file'
MemoryFileSystem: the latest release started to raise in both cases:
OK, if that's used as the reference, that's indeed clear.
I personally find the FileExistsError a bit confusing since it's not a file but a directory that exists, but yeah os.mkdir does that as well.
In the latest release, the
MemoryFileSystem
started to raise an error inmkdir
if the target directory already exists as a directory. I think this changed in #654, and it might also have been a deliberate change. But it is inconsistent how the local filesystem works.LocalFileSystem: works to create existing directory but fails if it already exists as a file:
MemoryFileSystem: the latest release started to raise in both cases:
I don't know what the specified behaviour should be (since the specification isn't clear about this: https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.mkdir).
The text was updated successfully, but these errors were encountered: