From f9970bd1af5bf79084e6be38bf854b811216428b Mon Sep 17 00:00:00 2001 From: "rongfu.leng" Date: Fri, 28 Mar 2025 12:46:06 +0800 Subject: [PATCH] fix: when use SGLANG_PORT this env,port is str (#4528) Signed-off-by: rongfu.leng --- python/sglang/srt/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/sglang/srt/utils.py b/python/sglang/srt/utils.py index f095f71b7..f325050c7 100644 --- a/python/sglang/srt/utils.py +++ b/python/sglang/srt/utils.py @@ -1602,6 +1602,7 @@ def get_ip() -> str: def get_open_port() -> int: port = os.getenv("SGLANG_PORT") if port is not None: + port = int(port) while True: try: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: