[Python-Dev] file read-ahead with Mac end-of-line

Aahz aahz at pythoncraft.com
Mon Aug 18 11:34:55 EDT 2003

On Mon, Aug 18, 2003, Skip Montanaro wrote:
>     >> We'll have to consider whether universal newline mode - along with an
>     >> implicit restriction in possible EOL sequences - is the way to go.
>     aahz> How about EOL is None means universal newlines and is the default?
> My worry is that if you have (for example) a \n embedded in a field when the
> EOL character is a \r that the parsing would get screwed up.  That \n is a
> character in a field, not the end of a record.  (Such fields may always have
> to be quoted, but I'm not sure.)  At this level it's really an issue for
> Andrew MacNamara or Dave Cole.  I'm not too familiar with the underlying C
> code. 

Then that person needs to specify '\r' as EOL (and open the file as
binary).  There's no one-size fits all and yes, you normally do need to
quote string fields with embedded newlines with CSV.
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

This is Python.  We don't care much about theory, except where it intersects 
with useful practice.  --Aahz

More information about the Python-Dev mailing list