ipfs-shipyard/py-ipfs-http-client

swarm.connect() returns failed to parse multiaddr "": empty multiaddr

iosifpeterfi opened this issue · 2 comments

py-ipfs-http-client = 0.6.1
ipfs = 0.6.0

It appears the arguments are not allocated properly.

client/swarm.py:

            args = (str(address), *(str(a) for a in address))
            return self._client.request('/swarm/disconnect', args, decoder='json', **kwargs)

This builds an URL like: http+ip4://127.0.0.1:5001/api/v0/swarm/connect?stream-channels=true&arg=%2Fip4%2FXX.XX.XX.XX%2Ftcp%2F4001%2Fipfs%2FPEERADDRESS&arg=%2F&arg=i&arg=p&arg=4&arg=%2F&arg=X&arg=X&arg=.&arg=X&arg=X&arg=.&arg=X&arg=.&arg=X&arg=X&arg=%2F&arg=t&arg=c&arg=p&arg=%2F&arg=4&arg=0&arg=0&arg=1&arg=%2F&arg=i&arg=p&arg=f&arg=s&arg=%2F&arg=P&arg=E&arg=E&arg=R&arg=A&arg=D&arg=D&arg=R&arg=E&arg=S&arg=S

Are all this extra arguments needed?

Please let me know so I can submit a PR to fix this.

lidel commented

Pretty sure it is a bug: each extra argument is just a single character of multiaddr.

Yes, that's a bug the second part should refer to addresses, not address!