summaryrefslogtreecommitdiffstats
path: root/Demo/sockets/udpecho.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-11-08 17:24:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-11-08 17:24:34 (GMT)
commit06fd5f8cc854c79b5a4b113d7ef9ab01227d94cf (patch)
tree36c5625b8dcb782c92f6e67fc566659c3dda9fce /Demo/sockets/udpecho.py
parentef6a19e3eab6dca9ef7eba92b636a4c2e88979c4 (diff)
downloadcpython-06fd5f8cc854c79b5a4b113d7ef9ab01227d94cf.zip
cpython-06fd5f8cc854c79b5a4b113d7ef9ab01227d94cf.tar.gz
cpython-06fd5f8cc854c79b5a4b113d7ef9ab01227d94cf.tar.bz2
fix the socketserver demo code for py3k
#4275 Thanks to Don MacMillen
Diffstat (limited to 'Demo/sockets/udpecho.py')
-rwxr-xr-xDemo/sockets/udpecho.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Demo/sockets/udpecho.py b/Demo/sockets/udpecho.py
index 8a6bd21..9966fd8 100755
--- a/Demo/sockets/udpecho.py
+++ b/Demo/sockets/udpecho.py
@@ -56,7 +56,8 @@ def client():
line = sys.stdin.readline()
if not line:
break
- s.sendto(line, addr)
+ print('addr = ', addr)
+ s.sendto(bytes(line, 'ascii'), addr)
data, fromaddr = s.recvfrom(BUFSIZE)
print('client received %r from %r' % (data, fromaddr))