mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
SF patch# 1764815 by Paul Colomiets.
Fix for test_socketserver. Use io.BytesIO instead of io.StringIO, and adjust tests.
This commit is contained in:
parent
ad8d30092c
commit
15863ea07a
2 changed files with 6 additions and 6 deletions
|
@ -574,10 +574,10 @@ class DatagramRequestHandler(BaseRequestHandler):
|
|||
"""Define self.rfile and self.wfile for datagram sockets."""
|
||||
|
||||
def setup(self):
|
||||
from io import StringIO
|
||||
from io import BytesIO
|
||||
self.packet, self.socket = self.request
|
||||
self.rfile = StringIO(self.packet)
|
||||
self.wfile = StringIO()
|
||||
self.rfile = BytesIO(self.packet)
|
||||
self.wfile = BytesIO()
|
||||
|
||||
def finish(self):
|
||||
self.socket.sendto(self.wfile.getvalue(), self.client_address)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue