From: Guido van Rossum Date: Mon, 30 Sep 1996 22:02:50 +0000 (+0000) Subject: Always open file objects in binary mode. X-Git-Tag: v1.4~160 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=24611f80e8d48efcdf469fde00729ff6c1ca4128;p=thirdparty%2FPython%2Fcpython.git Always open file objects in binary mode. --- diff --git a/Lib/ftplib.py b/Lib/ftplib.py index e42ed8c6dfc6..e24036a2019b 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -111,7 +111,7 @@ class FTP: self.passiveserver = 0 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() def getwelcome(self): @@ -323,7 +323,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`