diff options
| author | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-10-17 21:23:14 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-17 21:23:14 +1000 |
| commit | 735ecb99b6def1f0dd7aa480e3a81334ae740a0f (patch) | |
| tree | ce1a92c82c735479ce89ba3258a866d998e286c9 /rdflib/parser.py | |
| parent | 9a9ca7c37d936d7ae00134226a8d249d6a97fed7 (diff) | |
| parent | 49462fddad2bd2ff148134b49241e1c9d5a8e09f (diff) | |
| download | rdflib-ttl2.tar.gz | |
Merge branch 'master' into ttl2ttl2
Diffstat (limited to 'rdflib/parser.py')
| -rw-r--r-- | rdflib/parser.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rdflib/parser.py b/rdflib/parser.py index 51e06fbb..f0014150 100644 --- a/rdflib/parser.py +++ b/rdflib/parser.py @@ -307,10 +307,13 @@ def create_input_source( def _create_input_source_from_location(file, format, input_source, location): - # Fix for Windows problem https://github.com/RDFLib/rdflib/issues/145 - path = pathlib.Path(location) - if path.exists(): - location = path.absolute().as_uri() + # Fix for Windows problem https://github.com/RDFLib/rdflib/issues/145 and + # https://github.com/RDFLib/rdflib/issues/1430 + # NOTE: using pathlib.Path.exists on a URL fails on windows as it is not a + # valid path. However os.path.exists() returns false for a URL on windows + # which is why it is being used instead. + if os.path.exists(location): + location = pathlib.Path(location).absolute().as_uri() base = pathlib.Path.cwd().as_uri() |
