Closed avelanarius closed 10 months ago
Do we have tests for Unix sockets?
There is this test: https://github.com/scylladb/python-driver/blob/64e7fad42ec88dfc72c7f12c389c3ef6c3f392fb/tests/integration/advanced/test_unixsocketendpoint.py
but it's not enabled. I'll check if this test works.
Before this fix, the debug log would crash
_connect_socket
for UNIX domain sockets.getsockname()
for UNIX domain sockets returns a single string instead of a tuple (as is the case for IPv4/IPv6). Therefore the code could crash as it tried to get the second element of a non-tuple (empty string):Fix the issue by not unpacking those values and just printing them as-is, relying on
%s
formatter to print all elements of a tuple (host, port) for IP sockets and string for UNIX domain sockets. The printed log is not formatted as nice as before, however this is aDEBUG
print so few users will ever see it. The new approach should work with any format ofgetsockname()
.Fixes #278