[issue45746] ftplib please revisit retrlines('RETR as it produces files without newlines

Matthew H. McKenzie report at bugs.python.org
Mon Nov 8 01:49:54 EST 2021


Matthew H. McKenzie <github1 at swellhunter.org> 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 <report at bugs.python.org>
<https://bugs.python.org/issue45746>
_______________________________________


More information about the Python-bugs-list mailing list