[Twisted-Python] ftpClient.py, retrieveFile, and line ending issues

Itamar Shtull-Trauring itamar at itamarst.org
Tue Dec 6 15:50:53 MST 2005


On Tue, 2005-12-06 at 16:41 -0600, Keith.Gunderson at act.org wrote:

> class FileWriterProtocol(Protocol):
>     def __init__(self, filename):
>         self.file = open(filename, 'w')

You probably want open(filename, "wb"), which implies binary mode. On
Unix this does nothing, on Windows it keeps Windows from screwing with
your data line endings.





More information about the Twisted-Python mailing list