From 2bb57b81f211f5c16d9542620b180dd5097d57c7 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 14 Feb 1996 16:06:24 +0000 Subject: [PATCH] Changed makefile() args from r/w to rb/wb, for non-unix compatability. --- Lib/SocketServer.py | 4 ++-- Lib/ftplib.py | 4 ++-- Lib/gopherlib.py | 2 +- Lib/httplib.py | 2 +- Lib/nntplib.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index b6152470196..9a646ab6eb7 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -392,8 +392,8 @@ class StreamRequestHandler(BaseRequestHandler): def setup(self): self.connection = self.request - self.rfile = self.connection.makefile('r') - self.wfile = self.connection.makefile('w', 0) + self.rfile = self.connection.makefile('rb') + self.wfile = self.connection.makefile('wb', 0) def finish(self): self.wfile.flush() diff --git a/Lib/ftplib.py b/Lib/ftplib.py index e6e1a3aafc0..59eef65221d 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -95,7 +95,7 @@ class FTP: if port: self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect(self.host, self.port) - self.file = self.sock.makefile('r') + self.file = self.sock.makefile('rb') self.welcome = self.getresp() # Get the welcome message from the server @@ -288,7 +288,7 @@ class FTP: if not callback: callback = print_line resp = self.sendcmd('TYPE A') conn = self.transfercmd(cmd) - fp = conn.makefile('r') + fp = conn.makefile('rb') while 1: line = fp.readline() if self.debugging > 2: print '*retr*', `line` diff --git a/Lib/gopherlib.py b/Lib/gopherlib.py index 7550d5c6071..cf06e958301 100644 --- a/Lib/gopherlib.py +++ b/Lib/gopherlib.py @@ -69,7 +69,7 @@ def send_selector(selector, host, port = 0): s.connect(host, port) s.send(selector + CRLF) s.shutdown(1) - return s.makefile('r') + return s.makefile('rb') # Send a selector and a query string def send_query(selector, query, host, port = 0): diff --git a/Lib/httplib.py b/Lib/httplib.py index 3aeb643b641..ca431ab4cb2 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -82,7 +82,7 @@ class HTTP: self.send('\r\n') def getreply(self): - self.file = self.sock.makefile('r') + self.file = self.sock.makefile('rb') self.sock = None line = self.file.readline() if self.debuglevel > 0: print 'reply:', `line` diff --git a/Lib/nntplib.py b/Lib/nntplib.py index eafc9eb5652..b6b395703d7 100644 --- a/Lib/nntplib.py +++ b/Lib/nntplib.py @@ -68,7 +68,7 @@ class NNTP: self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect(self.host, self.port) - self.file = self.sock.makefile('r') + self.file = self.sock.makefile('rb') self.debugging = 0 self.welcome = self.getresp()