Skip to content

Commit 6944652

Browse files
authored
Fix 'Invalid port' error on Windows by using forward slash for URL construction (#128)
References: #127
1 parent 1740d91 commit 6944652

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pycsghub/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ def get_endpoint(endpoint: Optional[str] = None, operation: Optional[str] = OPER
545545

546546

547547
def get_xnet_endpoint(endpoint: str) -> str:
548-
return os.path.join(endpoint, XNET_API_PATH)
548+
# Use forward slash for URLs instead of os.path.join which uses backslash on Windows
549+
return f"{endpoint.rstrip('/')}/{XNET_API_PATH}"
549550

550551
def disable_xnet() -> bool:
551552
"""Check if xnet is disabled.

0 commit comments

Comments
 (0)