def encode_path_for_uri(path: str) -> str:
    """Percent-encode non-URL characters in a path."""
    return quote(path.replace(os.sep, "/"))
Percent-encode non-URL characters in a path.
src/bentoml/_internal/utils/uri.py