libb.safe_join
- safe_join(directory, *pathnames)[source]
Safely join untrusted path components to a base directory.
Prevents escaping the base directory via path traversal.
- Parameters:
- Returns:
A safe path, or
Noneif path would escape base.- Return type:
str | None
Note
Via github.com/mitsuhiko/werkzeug security.py