Always open file objects in binary mode.

This commit is contained in:
Guido van Rossum 1996-09-30 22:02:50 +00:00
parent 336c699236
commit 24611f80e8

View file

@ -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`