mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Always open file objects in binary mode.
This commit is contained in:
parent
336c699236
commit
24611f80e8
1 changed files with 2 additions and 2 deletions
|
@ -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`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue