Skip to content

Fix TestClient IPv6 base_url parsing#3368

Open
krrishapatel wants to merge 1 commit into
Kludex:mainfrom
krrishapatel:fix/testclient-ipv6
Open

Fix TestClient IPv6 base_url parsing#3368
krrishapatel wants to merge 1 commit into
Kludex:mainfrom
krrishapatel:fix/testclient-ipv6

Conversation

@krrishapatel

@krrishapatel krrishapatel commented Jul 6, 2026

Copy link
Copy Markdown

Related to #3357 (same class of bug — : splitting breaks IPv6).


TestClient with an IPv6 base_url like http://[::1]:8000 crashes with ValueError: invalid literal for int() with base 10: ':1]' because the netloc is split on : without accounting for bracket notation.

This adds IPv6-aware parsing that extracts the bare address and port from bracketed notation before falling through to the existing split logic.

Assisted-by: Claude Opus 4.6

Review in cubic

The netloc split on `:` failed for IPv6 addresses like `[::1]:8000`,
raising `ValueError: invalid literal for int()`. Now detects bracket
notation and extracts the bare IPv6 address and port correctly.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant