Can't access Windows UNC file URI when URI host part ist used for the UNC host
>>> Gio.File.new_for_uri("file://127.0.0.1/share").query_exists()
False # should be True
>>> Gio.File.new_for_uri("file://127.0.0.1/share").get_path()
# Returns None instead of '\\\\127.0.0.1\\share'
>>> Gio.File.new_for_uri("file:////127.0.0.1/share").query_exists()
True
>>> Gio.File.new_for_uri("file:////127.0.0.1/share").get_path()
'\\\\127.0.0.1\\share'
>>> Gio.File.new_for_uri("file://localhost/share").query_exists()
True
>>> Gio.File.new_for_uri("file:////localhost/share").query_exists()
True
For some reason when using an IP as a host and using the non-legacy file URI format using two slashes the path isn't accessible through glib.
get_path() returning None/NULL suggests that it fails to convert the URI to an UNC path.
If anyone is confused re 2 vs 4 slashes wikipedia has some info: https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes.3F
Edited by Christoph Reiter