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

Commit

Permalink
Merge pull request #115 from scikit-hep/issue-110
Browse files Browse the repository at this point in the history
Issue 110
  • Loading branch information
jpivarski authored Aug 7, 2018
2 parents f5bf675 + 5d17e40 commit 8c4b29f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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

0 comments on commit 8c4b29f

Please sign in to comment.