Char handling DOS vs Linux?

Tim Hammerquist tim at degree.ath.cx
Wed Sep 20 20:27:23 CEST 2000


David Lees <debl.spammono.nospammy at world.std.com> wrote:
> I wrote a short piece of python code running under 1.5.2 for striping
> out those extra carriage returns that DOS editors stick into text.  When
> I run this on my Linux box all works fine.  When I run the same code
> under Win 95 it does nothing.  It appears from using the debugger that
> the '\r' carriage returns are never seen when running under Windows.  Is
> there a different Python I/O function I should be using to see ALL the
> charaters in a file?

I'm not sure about Python, but we get the same question in clpm a lot
and from what I remember, '\r' is a macro which may be interpreted
differently on different platforms.  Is it possible in Python to
specify, for instance, '\x0d\x0a' instead of the occasionally
unpredictable '\r\n'?

-- 
-Tim Hammerquist <timmy at cpan.org>

My life has a superb cast but I can't figure out the plot.
	-- Ashleigh Brilliant



More information about the Python-list mailing list