summaryrefslogtreecommitdiff
path: root/rdflib/parser.py
diff options
context:
space:
mode:
authorGraham Higgins <gjh-github@bel-epa.com>2012-02-20 15:16:39 +0000
committerGraham Higgins <gjh-github@bel-epa.com>2012-02-20 15:16:39 +0000
commit49cc02f430490ececc8fadcbfc51f22ef59adb5f (patch)
tree984f2d68d74d6ed7bcb802c7b9155be7c1eb308a /rdflib/parser.py
parent687098fab76b650e699d84a5bfab1c1d076f7dc8 (diff)
downloadrdflib-49cc02f430490ececc8fadcbfc51f22ef59adb5f.tar.gz
Hopeful fix for https://github.com/RDFLib/rdflib/issues/145
Diffstat (limited to 'rdflib/parser.py')
-rw-r--r--rdflib/parser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/rdflib/parser.py b/rdflib/parser.py
index 6bafaa74..8ee128e9 100644
--- a/rdflib/parser.py
+++ b/rdflib/parser.py
@@ -145,6 +145,9 @@ def create_input_source(source=None, publicID=None,
raise Exception("Unexpected type '%s' for source '%s'" % (type(source), source))
if location is not None:
+ # Fix for Windows problem https://github.com/RDFLib/rdflib/issues/145
+ if os.path.exists(location):
+ location = pathname2url(location)
base = urljoin("file:", "%s/" % pathname2url(os.getcwd()))
absolute_location = URIRef(location, base=base).defrag()
if absolute_location.startswith("file:///"):