[Csv] skipfinalspace

Andrew McNamara andrewm at object-craft.com.au
Mon Oct 20 01:46:04 CEST 2008


>I downloaded the 2.6 source tar ball, but is it too late for new features to
>get into versions <3?

Yep.

>How would you feel about adding the following tests to Lib/test/test_csv.py
>and getting them to pass?
>
>Also http://www.python.org/doc/2.5.2/lib/csv-fmt-params.html says
>"*skipinitialspace *When True, whitespace immediately following the
>delimiter is ignored."
>but my tests show whitespace at the start of any field is ignored, including
>the first field.

I suspect (but I haven't checked) that it means "after the delimiter and
before any quoted field (or some variation on that).

All of the "dialect" parameters are there to allow parsing of a specific
common form of CSV file. Because there is no formal definition of the
format, the module simply aims to parse (and produce the same result)
as common applications such as Excel and Access. Changing the behaviour
in any non-backwards compatible way is sure to get screams of anguish
from many users. Even when the behaviour appears to be a bug, you can
be sure people are counting on it working like that.

BTW, this discussion probably should move to python-dev.

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


More information about the Csv mailing list