Message405921
Lib/ftplib.py function retrlines
Inspired by documentation the following writes a file without line-endings:
from ftplib import FTP
ftp=FTP()
ftp.connect('hostname')
ftp.login('user','xxxxxxxx')
ftp.sendcmd('pasv')
with open('crap2.txt', 'w') as fp:
ftp.retrlines('RETR crap.txt', fp.write)
Code goes to pains to slice off the line endings, and then print_line does not add them back? Apologies if this has been covered before, or I am not following the documentation correctly. Not going to suggest a fix as there may be a reason it is like this.
For RETR.
For ascii |
|
Date |
User |
Action |
Args |
2021-11-08 01:49:30 | mckenzm | set | recipients:
+ mckenzm |
2021-11-08 01:49:30 | mckenzm | set | messageid: <1636336170.65.0.433543407195.issue45746@roundup.psfhosted.org> |
2021-11-08 01:49:30 | mckenzm | link | issue45746 messages |
2021-11-08 01:49:30 | mckenzm | create | |
|