This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Daniel.Andersson
Recipients Daniel.Andersson, docs@python
Date 2014-04-18.11:52:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397821941.61.0.706896478348.issue21297@psf.upfronthosting.co.za>
In-reply-to
Content
Regarding the `skipinitialspace` parameter to the different CSV reader dialects in the `csv` module, the official documentation asserts:

    When True, whitespace immediately following the delimiter is ignored.

and the `help(csv)` style module documentation says:

    * skipinitialspace - specifies how to interpret whitespace which
      immediately follows a delimiter.  It defaults to False, which
      means that whitespace immediately following a delimiter is part
      of the following field.

"Whitespace" is a bit too general in both cases (at least a red herring in the second case), since it only skips spaces and not e.g. tabs [1].

In `Modules/_csv.c`, it more correctly describes the parameter. At line 81:

    int skipinitialspace;       /* ignore spaces following delimiter? */

and the actual implementation at line 638:

    else if (c == ' ' && dialect->skipinitialspace)
        /* ignore space at start of field */
        ;

No-one will probably assume that the whole UTF-8 spectrum of "whitespace" is skipped, but at least I initially assumed that the tab character was included.

[1]: http://en.wikipedia.org/wiki/Whitespace_character
History
Date User Action Args
2014-04-18 11:52:21Daniel.Anderssonsetrecipients: + Daniel.Andersson, docs@python
2014-04-18 11:52:21Daniel.Anderssonsetmessageid: <1397821941.61.0.706896478348.issue21297@psf.upfronthosting.co.za>
2014-04-18 11:52:21Daniel.Anderssonlinkissue21297 messages
2014-04-18 11:52:20Daniel.Anderssoncreate