[Bugfix] Fix port handling in make_zmq_path (#19117)

This commit is contained in:
Michael Goin
2025-06-04 23:00:59 -04:00
committed by GitHub
parent c56ed8bb0e
commit a408820f2f

View File

@@ -2461,7 +2461,7 @@ def make_zmq_path(scheme: str, host: str, port: Optional[int] = None) -> str:
Returns:
A properly formatted ZMQ path string.
"""
if not port:
if port is None:
return f"{scheme}://{host}"
if is_valid_ipv6_address(host):
return f"{scheme}://[{host}]:{port}"