[Csv] PEP 305

Andrew McNamara andrewm at object-craft.com.au
Mon Jun 7 06:47:58 CEST 2004


>I've a problem that I can't make the new CSV module fix - embedded \r's in 
>fields.  I'm parsing a format that allows \r and \n to be part of a field, if 
>the field is quoted with "".  Looking at Modules/_csv.c, this is probably 
>impossible....

If I remember correctly, you are correct - the current parser won't allow
you to do this.

One thing that became apparent very early on in the life of the
csv parser is that there is no end to variety of formats that call
themselves CSV!  We settled for something as close as we could make it
to Excel's behaviour, with the odd concession to Access, and any other
formats that were "easy", but that still leaves plenty of out in the cold.

Now that it's part of the Python core, it's a royal pain in the arse to
change anything, although your change is probably harmless, and we have
plenty of test cases. 

Dave - any idea why we disallowed CR within a quoted field?

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/


More information about the Csv mailing list