You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ipv6 address parsing error in postgresql conn string #838
import asyncpg
import asyncio
async def run():
conn = await asyncpg.connect(f"postgresql://postgres:patron@[fd74:ca9b:3a09:868c:0010:0009:0114:0067]:6321/postgres?sslmode=prefer")
await conn.close()
asyncio.run(run())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
return future.result()
File "<stdin>", line 2, in run
File "/usr/local/lib/python3.7/site-packages/asyncpg/connection.py", line 1727, in connect
max_cacheable_statement_size=max_cacheable_statement_size)
File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 656, in _connect
addrs, params, config = _parse_connect_arguments(timeout=timeout, **kwargs)
File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 497, in _parse_connect_arguments
server_settings=server_settings)
File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 237, in _parse_connect_dsn_and_args
host, port = _parse_hostlist(dsn_hostspec, port, unquote=True)
File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 197, in _parse_hostlist
hostlist_ports.append(int(hostspec_port))
ValueError: invalid literal for int() with base 10: 'ca9b:3a09:868c:0010:0009:0114:0067]:6321'`
$ pip show asyncpg
Name: asyncpg
Version: 0.21.0
Summary: An asyncio PostgreSQL driver
Home-page: https://github.com/MagicStack/asyncpg
Author: MagicStack Inc
Author-email: hello@magic.io
License: Apache License, Version 2.0
Location: /usr/local/lib/python3.7/site-packages
Requires:
Required-by:
$ postgresql version 13
Activity
Fix parsing of IPv6 addresses in the connection URI
Fix parsing of IPv6 addresses in the connection URI
Fix parsing of IPv6 addresses in the connection URI
Fix parsing of IPv6 addresses in the connection URI
Fix parsing of IPv6 addresses in the connection URI (#845)