[issue6822] Error calling .storlines from ftplib

Antoine Pitrou report at bugs.python.org
Fri Aug 27 19:58:05 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> But I can tell you that I've never had another FTP program fail like
> Python 3 is failing for me trying to what seems like a simple transfer
> of a text file (expecting the line endings to be adjusted).  

Python 3 is not failing, you are just using it the wrong way. Open your
file in binary mode (as opposed to text mode) and it should work. "Text
files" in Python 3 are files decoded to unicode while reading (and
encoded from unicode while writing); they are much more than simply
binary files with adaptive line endings. This is more or less documented
here (although I agree it would perhaps need a better introductory
paragraph):
http://docs.python.org/py3k/library/io.html

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6822>
_______________________________________


More information about the Python-bugs-list mailing list