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

Fix Base.parent by splitting on / only, fix #1161 #1162

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ function Base.parent(obj::Union{File,Group,Dataset})
if length(path) == 1
return f
end
parentname = dirname(path)
# Only split on / not \
# See "HDF5 Path Names and Navigation" under "The HDF5 Data Model and File Structure"
path_parts = split(path, "/")
parentname = join(path_parts[1:(end - 1)], "/")
if !isempty(parentname)
return open_object(f, dirname(path))
return open_object(f, parentname)
else
return root(f)
end
Expand Down
Loading