Convert the socket module to insist on bytes for input, and to return bytes

(not bytearray) on output.  Discovered a bunch of places that were still
depending on it accepting text strings.
This commit is contained in:
Guido van Rossum 2007-11-21 22:09:45 +00:00
parent b08340053c
commit 8a392d7387
8 changed files with 42 additions and 43 deletions

View file

@ -464,7 +464,8 @@ class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.end_headers()
else:
# got a valid XML RPC response
# Got a valid XML RPC response; convert to bytes first
response = response.encode("utf-8")
self.send_response(200)
self.send_header("Content-type", "text/xml")
self.send_header("Content-length", str(len(response)))