Skip to content

Commit 838672b

Browse files
maurycymiss-islington
authored andcommitted
gh-138005: Document that CSV skipinitialspace=True and delimiter=' ' require quotation for empty fields (GH-138006)
(cherry picked from commit e0f54a6) Co-authored-by: Maurycy Pawłowski-Wieroński <[email protected]>
1 parent 8a767fb commit 838672b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/csv.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ Dialects support the following attributes:
467467
.. attribute:: Dialect.skipinitialspace
468468

469469
When :const:`True`, spaces immediately following the *delimiter* are ignored.
470-
The default is :const:`False`.
470+
The default is :const:`False`. When combining ``delimiter=' '`` with
471+
``skipinitialspace=True``, unquoted empty fields are not allowed.
471472

472473

473474
.. attribute:: Dialect.strict
@@ -636,7 +637,7 @@ done::
636637
.. rubric:: Footnotes
637638

638639
.. [1] If ``newline=''`` is not specified, newlines embedded inside quoted fields
639-
will not be interpreted correctly, and on platforms that use ``\r\n`` linendings
640+
will not be interpreted correctly, and on platforms that use ``\r\n`` line endings
640641
on write an extra ``\r`` will be added. It should always be safe to specify
641642
``newline=''``, since the csv module does its own
642643
(:term:`universal <universal newlines>`) newline handling.

0 commit comments

Comments
 (0)