code: def path_to_url(path):
      
      path = os.path.normcase(os.path.abspath(path))
      if _drive_re.match(path):
          path = path[0] + '|' + path[2:]
      url = urllib.quote(path)
      url = url.replace(os.path.sep, '/')
      url = url.lstrip('/')
      return 'file:///' + url
docs: Convert a path to a file: URL.  The path will be made absolute.