Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/uproot/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ def file_object_path_split(urlpath: str) -> tuple[str, str | None]:

separator = "::"
parts = urlpath.split(separator)
object_regex = re.compile(r"(.+\.root):(.*$)", re.IGNORECASE)
object_regex = re.compile(r"(.+\.root(\.[0-9]+)?):(.*$)", re.IGNORECASE)
for i, part in enumerate(reversed(parts)):
match = object_regex.match(part)
if match:
obj = re.sub(r"/+", "/", match.group(2).strip().lstrip("/")).rstrip("/")
obj = re.sub(r"/+", "/", match.group(3).strip().lstrip("/")).rstrip("/")
parts[-i - 1] = match.group(1)
break

Expand Down
8 changes: 7 additions & 1 deletion tests/test_0976_path_object_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@
"Dir/Test",
),
),
(
"http://xcacheserver:8762//https://originserver:4212/path/file.root.1:CollectionTree",
(
"http://xcacheserver:8762//https://originserver:4212/path/file.root.1",
"CollectionTree",
),
),
],
)
def test_url_split(input_value, expected_output):
Expand Down Expand Up @@ -202,7 +209,6 @@ def test_url_no_split(input_value):
"local/file.root.zip://Events",
"local/file.roo://Events",
"local/file://Events",
"http://xcacheserver:8762//https://originserver:4212/path/file.root.1:CollectionTree",
],
)
def test_url_split_invalid(input_value):
Expand Down
Loading