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

Slashes in .h5 paths are converted to escaped backslashes #56

Closed
cjstephen opened this issue Oct 21, 2021 · 2 comments · Fixed by silx-kit/h5grove#42
Closed

Slashes in .h5 paths are converted to escaped backslashes #56

cjstephen opened this issue Oct 21, 2021 · 2 comments · Fixed by silx-kit/h5grove#42

Comments

@cjstephen
Copy link

Describe the bug

Trying to inspect an h5 file with tree structure "/confocal/XY/...something.../raw". On initially opening in h5web under jupyter, left pane shows "/confocal" but opening this gives a blank plane.

Digging into the errors I found the following which seems to suggest the second slash is converted to '\\'

{"message": "Unhandled error", "reason": null, "traceback": "Traceback (most recent call last):\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\tornado\web.py", line 1702, in _execute\n result = method(*self.path_args, **self.path_kwargs)\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\tornado\web.py", line 3173, in wrapper\n return method(self, *args, **kwargs)\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\jupyterlab_h5web\handlers.py", line 26, in get\n content = self.get_content(h5file, path)\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\jupyterlab_h5web\handlers.py", line 59, in get_content\n return content.metadata()\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\h5grove\content.py", line 151, in metadata\n ("children", self._get_child_metadata_content(depth - 1)),\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\h5grove\content.py", line 139, in _get_child_metadata_content\n return [\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\h5grove\content.py", line 140, in \n create_content(self._h5file, os.path.join(self._path, child_path)).metadata(\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\h5grove\content.py", line 160, in create_content\n entity = get_entity_from_file(h5file, path, resolve_links)\n File "C:\Users\u1774090\Anaconda3\envs\h5web\lib\site-packages\h5grove\utils.py", line 34, in get_entity_from_file\n raise PathError(f"{path} is not a valid path in {basename(h5file.filename)}")\nh5grove.utils.PathError: /confocal\\XY is not a valid path in session-20211021-131238.hdf5\n"}

Expected behaviour

Should allow traversal of an h5 tree from root

Screenshots

Context

  • OS: Windows 10
  • Browser: Edge
  • Version: [e.g. 22]
  • H5Web context: jupyterlab_h5web + @h5web/lib
@cjstephen
Copy link
Author

Above JS error attached to avoid escaping issues:
h5web-error.txt

@loichuder
Copy link
Member

Thanks for the report ! This should be fixed in jupyterlab-h5web's latest version (0.0.11)

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