[issue46220] imaplib.py "select" mailbox names containing spaces.
New submission from Matthew H. McKenzie : A mailbox (folder) need not be for a recipient and need not be the private part of an RFC2822 address. Passing a value of "000 Bookings" to select() results in validation issues when the tokens are parsed as arguments and there are too many. It would be a nice-to-have to accept spaces in the name. Workaround is for a rule to be applied by a desktop email client such as Evolution to move it from the INBOX upon discovery according to filter criteria. -- components: Library (Lib) messages: 409457 nosy: mckenzm priority: normal severity: normal status: open title: imaplib.py "select" mailbox names containing spaces. type: enhancement versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue46220> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines
New submission from Matthew H. McKenzie : 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','') 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 -- components: Library (Lib) files: crap2.txt messages: 405921 nosy: mckenzm priority: normal severity: normal status: open title: ftplib please revisit retrlines('RETR as it produces files without newlines versions: Python 3.11 Added file: https://bugs.python.org/file50429/crap2.txt ___ Python tracker <https://bugs.python.org/issue45746> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines
Matthew H. McKenzie added the comment: On the face of it it is my mistake for using the write method for my file. But read on. your write_line() adds an EOL, OK, because it wraps print(). So the retrlines() function strips them in anticipation? The error is arguably in my own code as I am passing write() as the callback and it is my fault for not adding line endings back? Nothing at all wrong with write_line as the callback, it echoes perfectly, to the console. But my files have no EOL. I need the EOL in my file writes and that is my own problem. It would be maybe be an enhancement not to strip them from the host, as it should understand ascii as CRLF even if the client is not a CRLF system. But that adds complexity - it needs to work as is for listings. My uploaded file was what was being retrieved. Maybe close this and I'll just do what everybody else does and clone retrlines(). Sorry for your trouble. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue45746> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines
Matthew H. McKenzie added the comment: To answer your original questions : Linux Host and Client, amd MVS (EBCDIC records) to Linux. hacks to overcome (in libftp): def print_line(line): '''Default retrlines callback to print a line.''' print(line, end='')< suppress here and... if not line: break if line[-2:] == CRLF: <== left these line = line[:-2] elif line[-1:] == '\n': line = line[:-1] callback(line + '\n') <== added it back here. -- ___ Python tracker <https://bugs.python.org/issue45746> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com