diff options
author | Guido van Rossum <guido@python.org> | 2007-11-21 22:09:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-11-21 22:09:45 (GMT) |
commit | 8a392d7387c9992537b0e1f66de989e34bd4eb4e (patch) | |
tree | 689dd92ee0ca56b2464982cb07b398af03f81f19 /Lib/test/test_urllib2_localnet.py | |
parent | b08340053cb10af7290628ed624e4f7ec6be398b (diff) | |
download | cpython-8a392d7387c9992537b0e1f66de989e34bd4eb4e.zip cpython-8a392d7387c9992537b0e1f66de989e34bd4eb4e.tar.gz cpython-8a392d7387c9992537b0e1f66de989e34bd4eb4e.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_urllib2_localnet.py')
-rw-r--r-- | Lib/test/test_urllib2_localnet.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index dde9504..f0b5dea 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -139,7 +139,7 @@ class DigestAuthHandler: # not. #request_handler.send_header('Connection', 'close') request_handler.end_headers() - request_handler.wfile.write("Proxy Authentication Required.") + request_handler.wfile.write(b"Proxy Authentication Required.") return False def handle_request(self, request_handler): @@ -210,9 +210,10 @@ class FakeProxyHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.send_response(200, "OK") self.send_header("Content-Type", "text/html") self.end_headers() - self.wfile.write("You've reached %s!<BR>" % self.path) - self.wfile.write("Our apologies, but our server is down due to " - "a sudden zombie invasion.") + self.wfile.write(bytes("You've reached %s!<BR>" % self.path, + "ascii")) + self.wfile.write(b"Our apologies, but our server is down due to " + b"a sudden zombie invasion.") # Test cases |