fix: report a malformed Redis URL instead of raising from urlsplit

urlsplit raises ValueError on input such as redis://[::1 , which nothing
converted, so a typo left native setup with a traceback rather than the message
every other unusable URL gets.
This commit is contained in:
Alex committed 2026-09-16 23:30:47 +01:00
1 parent 65ee2f4201
commit c8ab1cbab2
2 files changed
+21 -1

No files matched your search

+5 -1
View File
@@ -209,7 +209,11 @@ def _redis_urls(base: str) -> dict[str, str]:
Everything else in the URL is kept — TLS, credentials, and query parameters such as the
``ssl_cert_reqs`` that a rediss:// endpoint usually needs.
"""
parts = urlsplit(base)
try:
parts = urlsplit(base)
except ValueError as exc:
# urlsplit raises on things like redis://[::1 ; that is a typo, not a crash.
raise DeployError(f"the Redis URL {base!r} could not be read: {exc}") from exc
if parts.scheme not in ("redis", "rediss"):
raise DeployError(
f"the Redis URL {base!r} should start with redis:// or rediss://, with any options as "