According to the FTP.retrlines
documentation:
... The callback function is called for each line with a string argument containing the line with the trailing CRLF stripped. ....
Replace retrlines
with retrbinary
.
Alternatively, you can ..retrlines ..
lines as follow (appending newlines):
ftp.retrlines('RETR cbt.settle.s.txt', lambda line: settles.write(line + '\n'))