init commit

This commit is contained in:
2025-05-06 20:44:33 +09:00
commit 91f0d54563
5567 changed files with 948185 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
from __future__ import annotations
# Follow Django in treating URLs as UTF-8 encoded (which requires undoing the
# implicit ISO-8859-1 decoding applied in Python 3). Strictly speaking, URLs
# should only be ASCII anyway, but UTF-8 can be found in the wild.
def decode_path_info(path_info):
return path_info.encode("iso-8859-1", "replace").decode("utf-8", "replace")
def ensure_leading_trailing_slash(path):
path = (path or "").strip("/")
return f"/{path}/" if path else "/"