diff --git a/lib/rdf/util/file.rb b/lib/rdf/util/file.rb index c17fcd3f..1e5148ae 100644 --- a/lib/rdf/util/file.rb +++ b/lib/rdf/util/file.rb @@ -323,6 +323,10 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false, # 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 = url_no_frag_or_query.path + if url_no_frag_or_query.match?(/^\/[A-Za-z]:/) && Gem.win_platform? + # Turns "/D:foo" into "D:foo" + url_no_frag_or_query = url_no_frag_or_query[1..-1] + end end Kernel.open(url_no_frag_or_query, "r", **options) do |file|