diff --git a/lib/rdf/util/file.rb b/lib/rdf/util/file.rb index a4b8e4c8..c17fcd3f 100644 --- a/lib/rdf/util/file.rb +++ b/lib/rdf/util/file.rb @@ -320,9 +320,9 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false, url_no_frag_or_query.fragment = nil options[:encoding] ||= Encoding::UTF_8 - # Normalize a file scheme further + # Just use path if there's a file scheme. This leaves out a potential host, which isn't supported anyway. if url_no_frag_or_query.scheme == 'file' - url_no_frag_or_query = "file:///#{url_no_frag_or_query.path}" + url_no_frag_or_query = url_no_frag_or_query.path end Kernel.open(url_no_frag_or_query, "r", **options) do |file|