code: def pretty_path(path):
      
      path = fmt.to_utf8(path)
      home_dir = os.path.expanduser("~")
      if path.startswith(home_dir):
          path = "~" + path[len(home_dir):]
      return '"%s"' % (path,)
docs: Prettify path for logging.