[Zope-CMF] Re: [OT] CVS, PythonScripts and Line Endings

Chris Withers chrisw@nipltd.com
Thu, 31 May 2001 21:26:44 +0100


> I just fixed the FSPythonScript module yesterday to deal with that
> issue (opening the script file in 'rb' mode).

Hurm... that's exactly what we do in the test harness... :-(

> As for your problem with
> creating PythonScripts via HTTP:  I can't reproduce this with either
> cadaver or ncftp, although I explicitly forced carriage returns into
> the test file.  You could probably fix the testing harness to open the
> files in text mode, and the problem would go away, as well.

I did have a look in the testharness code and we create the python scripts
using a MIME-encoded HTTP post where the source of the script is in an
attachment called 'file' (just like the PythonScript add form, AFAICT). That
file is read from disk 'rb' and then we get the problem.

I can see how opening it text mode would solve the problem, which I think is
introduced by CVS helpfully fixing the line endings when you check out (the
problem happens whenever the script is checked out on a different OS to the
one it was checked in on, IIRC) but I guess my real issue is why Python
Scripts (or is it python in general?) are so fussy about line endings?

cheers,

Chris