Skip to content

Preserve multi-host DSN parsing on Python 3.16 - #1410

Open
itisrmk wants to merge 1 commit into
MagicStack:masterfrom
itisrmk:devin/1795853084-parse-multi-host-dsns
Open

itisrmk wants to merge 1 commit into
MagicStack:masterfrom
itisrmk:devin/1795853084-parse-multi-host-dsns

Conversation

@itisrmk

@itisrmk itisrmk commented Nov 28, 2026

Copy link
Copy Markdown

Addresses the DSN parsing regression in #1409.

Python 3.16 validates URL ports during parsing, so it rejects a PostgreSQL DSN containing multiple host:port pairs before asyncpg can interpret the host list. Validate each host separately when the generic URL parser rejects a multi-host DSN, then let asyncpg parse the original list. Added a regression case combining IPv6 and IPv4 hosts.

Verified on CPython 3.16.0a2: all 11 connection-parameter tests and 60 subtests passed. Flake8 passed.

AI disclosure: Devin drafted the patch and regression test.

This branch has not been deployed

No deployments
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