[Misc] Replace urllib's urlparse with urllib3's parse_url (#32746)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
This commit is contained in:
Isotr0py
2026-01-22 16:37:15 +08:00
committed by GitHub
parent 49a1262267
commit 8ebf271bb6
4 changed files with 23 additions and 16 deletions

View File

@@ -11,12 +11,12 @@ from collections.abc import (
Sequence,
)
from typing import Any
from urllib.parse import urlparse
from uuid import uuid4
import psutil
import zmq
import zmq.asyncio
from urllib3.util import parse_url
import vllm.envs as envs
from vllm.logger import init_logger
@@ -217,13 +217,15 @@ def find_process_using_port(port: int) -> psutil.Process | None:
def split_zmq_path(path: str) -> tuple[str, str, str]:
"""Split a zmq path into its parts."""
parsed = urlparse(path)
parsed = parse_url(path)
if not parsed.scheme:
raise ValueError(f"Invalid zmq path: {path}")
scheme = parsed.scheme
host = parsed.hostname or ""
port = str(parsed.port or "")
if host.startswith("[") and host.endswith("]"):
host = host[1:-1] # Remove brackets for IPv6 address
if scheme == "tcp" and not all((host, port)):
# The host and port fields are required for tcp