Was passing an empty string by mistake, if no port was specified. Mostly
not a problem, except on some platforms, where it causes an
"unrecognized service" error.
Close #366.
``psycopg`` release notes
=========================
+Future releases
+---------------
+
+Psycopg 3.0.18
+^^^^^^^^^^^^^^
+
+- Fix possible "unrecognized service" error in async connection when no port
+ is specified (:ticket:`#366`).
+
+
Current release
---------------
hosts_in = host_arg.split(",")
port_arg: str = str(params.get("port", os.environ.get("PGPORT", "")))
- ports_in = port_arg.split(",")
+ ports_in = port_arg.split(",") if port_arg else []
if len(ports_in) == 1:
# If only one port is specified, the libpq will apply it to all