summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2017-08-17 14:59:08 +0200
committerTomas Krizek <tkrizek@redhat.com>2017-08-18 11:48:51 +0200
commitb1fbdbefdb201fc036e41e84a25e3e0725d8e3d2 (patch)
treec97edb9e476f9d4044f3eb9cd187b81eedae56a6 /ipapython
parentf7d1a10f22548fb2c1eba99a3001c6da49605edd (diff)
ipautil: port host_port_open() to python 3
socket.send() expects `Bytes` instance, not string https://pagure.io/freeipa/issue/4985 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipautil.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 1786996ec..c5c5e9e21 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -983,7 +983,7 @@ def host_port_open(host, port, socket_type=socket.SOCK_STREAM,
s.connect(sa)
if socket_type == socket.SOCK_DGRAM:
- s.send('')
+ s.send(b'')
s.recv(512)
except socket.error:
port_open = False