From: Roger A. Light Date: Mon, 28 Jul 2014 13:21:04 +0000 (+0100) Subject: [439277] Fix Client constructor for the case where "localhost" is unresolvable. X-Git-Tag: v1.1~13 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=849cd83ddf899b79caae33b1eb4d3711a3db4008;p=packages%2Fp%2Fpaho-mqtt.git [439277] Fix Client constructor for the case where "localhost" is unresolvable. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=439277 Change-Id: I05d268e4fbaba56116ea35bc8b2dc2c7f31ca2a9 --- diff --git a/ChangeLog.txt b/ChangeLog.txt index 5feae68..32e5704 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,8 @@ v1.0.2 ====== - Fix "protocol" not being used in publish.single() +- Fix Client constructor for the case where "localhost" is unresolvable. + Closes #439277. v1.0.1 ====== diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 77d939a..93308d2 100755 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -252,7 +252,7 @@ def _socketpair_compat(): """TCP/IP socketpair including Windows support""" listensock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) listensock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - listensock.bind(("localhost", 0)) + listensock.bind(("127.0.0.1", 0)) listensock.listen(1) iface, port = listensock.getsockname()