Skip to content

gh-138005: Document that CSV skipinitialspace=True and delimiter=' ' require quotation for empty fields #138006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Doc/library/csv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ Dialects support the following attributes:
.. attribute:: Dialect.skipinitialspace

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


.. attribute:: Dialect.strict
Expand Down Expand Up @@ -636,7 +637,7 @@ done::
.. rubric:: Footnotes

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