[Distutils] lineendings

M.-A. Lemburg mal@lemburg.com
Wed Oct 16 03:24:01 2002


Andy Robinson wrote:
>>Of course, the right solution would be getting a decent
>>text editor ;-)
> 
> 
> No, it wouldn't.  We have decent editors.  But we ship
> code to people maintaining Unix systems, who should
> neither know nor care if it is Java or Python or Algol.
> If they have to edit some config file in VI when logged
> into a remote server, it's just wrong to ship it full of 
> ^M thingies; someone actually phoned me and asked if it was 
> safe to promote!  At the same time I would quite like the
> freedom to make a package on my Windows machine, or even
> on a Mac. (BTW, does OS/X have Unix line endings?)
> 
> I think the right solution is "a few subclasses" and one
> day some options in distutils to set this if you choose
> to.  Distutils knows which files are source, tar and zip
> cannot be expected to.

That's true, but currently distutils isn't messing with
line ends in source code at all -- at least not from
what I've seen in the source code or in practice. It does
use Unix line ends in some generated files, though.

One thing you should consider is shipping the software
using Unix line ends to both Windows and Macs. All sane
editors in those two worlds know how to deal with Unix
file ends (no, Notepad is not a sane editor, it's a
text widget demonstration :-).

Even if you would be able to define the line endings
for various different files by means of options, you'd
still run into problems, since files created by your
applications wouldn't change, so things would only
be half backed in the end. Another problem is that
of platform dependent text file mode: on some platforms
this adds/removes the CR LF, on others just LF, no idea
what Macs do... it's just a mess.

> Putting it in perspective:  we had a quiet day and all
> decided to learn distutils, so we may ask some pretty
> dumb things before we grasp its inner beauty, elegance
> and fundamental rightness  ;-)

Oh dear ;-)

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/