8 lines
173 B
Python
8 lines
173 B
Python
from urllib.parse import quote
|
|
|
|
|
|
def encode_path(path: str) -> str:
|
|
if not path:
|
|
return ""
|
|
return "/".join(quote(part, safe="") for part in path.split("/"))
|