def path_to_uri(path):
 if isinstance(path, compat.text_type):
  path = path.encode(u'utf-8')
 path = urllib.parse.quote(path)
 return urllib.parse.urlunsplit(('file', '', path, '', ''))

def path_to_uri ( path ) : if isinstance ( path , compat . text_type ) : path = path . encode ( u'utf-8' ) path = urllib . parse . quote ( path ) return urllib . parse . urlunsplit ( ( 'file' , '' , path , '' , '' ) )
convert file path to uri .