Initial commit: igny8 project

This commit is contained in:
igny8
2025-11-09 10:27:02 +00:00
commit 60b8188111
27265 changed files with 4360521 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 "/"