diff options
author | Guido van Rossum <guido@python.org> | 1996-09-30 22:02:50 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-09-30 22:02:50 (GMT) |
commit | 24611f80e8d48efcdf469fde00729ff6c1ca4128 (patch) | |
tree | d62bb33fe28c2f2ae2837e01cc25f6b23ac98e13 /Lib | |
parent | 336c699236ab04e8b441b2fcf382c382e3d95631 (diff) | |
download | cpython-24611f80e8d48efcdf469fde00729ff6c1ca4128.zip cpython-24611f80e8d48efcdf469fde00729ff6c1ca4128.tar.gz cpython-24611f80e8d48efcdf469fde00729ff6c1ca4128.tar.bz2 |
Always open file objects in binary mode.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ftplib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index e42ed8c..e24036a 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` |