Open
Description
Observed behavior
Providing more than one server URL to connect to results in an error.
This works:
nc = await nats.connect("nats://demo.nats.io:4222")
This does not:
nc = await nats.connect("nats://demo1.nats.io:4222,nats://demo2.nats.io:4222,")
It throws an error:
File "[...]/main.py", line 8, in main
nc = await nats.connect("nats://demo.nats.io:4222,nats://demo.nats.io:4223")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[...]/.venv/lib/python3.11/site-packages/nats/__init__.py", line 45, in connect
await nc.connect(servers, **options)
File "[...]/.venv/lib/python3.11/site-packages/nats/aio/client.py", line 417, in connect
self._setup_server_pool(servers)
File "[...]/.venv/lib/python3.11/site-packages/nats/aio/client.py", line 1265, in _setup_server_pool
raise errors.Error("nats: invalid connect url option")
nats.errors.Error: nats: invalid connect url option
Expected behavior
For parity with other clients, multiple server URLs should be accepted
Server and client version
nats-py-2.7.2
(current release)
Server version is not relevant.
Host environment
Python 3.11.3
The rest is not relevant
Steps to reproduce
Create a connection with a string that contains multiple server URLs, e.g.: nats.connect("nats://demo1.nats.io:4222,nats://demo2.nats.io:4222,")