Skip to content

Commit e0f54a6

Browse files
authored
gh-138005: Document that CSV skipinitialspace=True and delimiter=' ' require quotation for empty fields (#138006)
1 parent 32e1e06 commit e0f54a6

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
@@ -468,7 +468,8 @@ Dialects support the following attributes:
468468
.. attribute:: Dialect.skipinitialspace
469469

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

473474

474475
.. attribute:: Dialect.strict
@@ -637,7 +638,7 @@ done::
637638
.. rubric:: Footnotes
638639

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

0 commit comments

Comments
 (0)