Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Issue 110 #115

Merged
merged 4 commits into from
Aug 7, 2018
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
7 changes: 7 additions & 0 deletions uproot/rootio.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
################################################################ high-level interface

def open(path, localsource=MemmapSource.defaults, xrootdsource=XRootDSource.defaults, httpsource=HTTPSource.defaults, **options):
if hasattr(path, "__fspath__"):
path = path.__fspath__()
if path.__class__.__module__ == "pathlib":
import pathlib
if isinstance(path, pathlib.Path):
path = str(path)

parsed = urlparse(path)
if _bytesid(parsed.scheme) == b"file" or len(parsed.scheme) == 0:
path = parsed.netloc + parsed.path
Expand Down
6 changes: 6 additions & 0 deletions uproot/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ def _delayedraise(excinfo):
raise err.with_traceback(trc)

def _filename_explode(x):
if hasattr(x, "__fspath__"):
x = x.__fspath__()
if x.__class__.__module__ == "pathlib":
import pathlib
if isinstance(x, pathlib.Path):
x = str(x)
parsed = urlparse(x)
if _bytesid(parsed.scheme) == b"file" or len(parsed.scheme) == 0:
pattern = os.path.expanduser(parsed.netloc + parsed.path)
Expand Down
2 changes: 1 addition & 1 deletion uproot/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import re

__version__ = "2.9.10"
__version__ = "2.9.11"
version = __version__
version_info = tuple(re.split(r"[-\.]", __version__))

Expand Down