-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
When you try running ome_zarr finder . in a directory with read-only permission, you currently get:
Traceback (most recent call last):
File "/<user_path>/.pixi/envs/ome-zarr/bin/ome_zarr", line 10, in <module>
sys.exit(main())
~~~~^^
File "/<user_path>/.pixi/envs/ome-zarr/lib/python3.13/site-packages/ome_zarr/cli.py", line 210, in main
ns.func(ns)
~~~~~~~^^^^
File "/<user_path>/.pixi/envs/ome-zarr/lib/python3.13/site-packages/ome_zarr/cli.py", line 44, in finder
bff_finder(args.path, args.port)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/<user_path>/.pixi/envs/ome-zarr/lib/python3.13/site-packages/ome_zarr/utils.py", line 250, in finder
with open(bff_csv, "w", newline="") as csvfile:
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: './biofile_finder.csv'
I suggest wrapping these lines in a try .. catch clause:
Lines 256 to 257 in 77e6d63
| with open(bff_csv, "w", newline="") as csvfile: | |
| writer = csv.writer(csvfile, delimiter=",") |
.. and providing a more informative error message, such as:
'ome_zarr finder' needs write permission, the provided location {location} seems to be read-only.
Metadata
Metadata
Assignees
Labels
No labels