[Zope3-dev] CRLF in text from forms

Guido van Rossum guido@python.org
Fri, 16 May 2003 08:40:07 -0400


I noticed that multi-line text entered in schema-generated forms
contains CRLF as line delimiters.  At least, when I create a document
containing text (e.g. a file or a dtml page) using a form, and then
use fssync to dump it to the filesystem, I have something with CRLF
delimiters.  I think that's wrong, and the form machinery should
replace CRLF with LF.  That's as simple as

  t = t.replace("\r\n", "\n")

but I wouldn't know where to put it, so I'm hoping that someone else
can fix this.

(Why is it IMO wrong to have CRLF delimiters?  Because the data we're
storing is processed by Python text processing code, and Python always
assumes LF delimiters for text.  And we know damn well that it's text,
because it came from a TEXT widget. :-)

PS I'll be on vacation until May 26.

--Guido van Rossum (home page: http://www.python.org/~guido/)