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

Strange error message when trying to r+ open a file that does not exist #205

Open
pgunn opened this issue Apr 4, 2022 · 1 comment
Open

Comments

@pgunn
Copy link
Contributor

pgunn commented Apr 4, 2022

paradox:~/src/caiman_dev-clean$ python
Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:25:59) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import z5py
>>> fh = z5py.File('/tmp/experiment.zarr', 'r+')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pgunn/miniconda3/envs/caiman/lib/python3.9/site-packages/z5py/file.py", line 84, in __init__
    raise OSError(errno.EROFS, os.strerror(errno.EROFS), handle.path())
OSError: [Errno 30] Read-only file system: '/tmp/experiment.zarr'
>>> fh = z5py.File('/tmp/experiment.zarr', 'w')

That "read-only filesystem" message is bizarre.

@constantinpape
Copy link
Owner

This error is thrown here: https://github.com/constantinpape/z5/blob/master/src/python/module/z5py/file.py#L84
When trying to open a file in r or r+ that doesn't exist.

I agree that the error could be improved, PRs are welcome.

For reference, here's what h5py throws in this situation:

h5py.File("x.h5", "r+")
FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = 'x.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

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