Skip to content

Commit 3bf1d88

Browse files
committed
just one sentence
1 parent 6e4b9a5 commit 3bf1d88

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

Doc/library/csv.rst

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -467,25 +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`.
471-
472-
.. note::
473-
474-
When combining ``delimiter=' '`` (a space) with ``skipinitialspace=True``,
475-
the writer must quote empty fields.
476-
477-
If an unquoted empty field would be emitted (for example writing ``''`` or
478-
values that become empty like :data:`None` under some quoting modes),
479-
:class:`writer` raises :exc:`csv.Error`. Quoting (the default
480-
:data:`QUOTE_MINIMAL` is sufficient) avoids this error.
481-
482-
Example::
483-
484-
>>> import csv, io
485-
>>> buf = io.StringIO()
486-
>>> w = csv.writer(buf, delimiter=' ', skipinitialspace=True,
487-
... quoting=csv.QUOTE_NONE)
488-
>>> w.writerow(['', 'x']) # raises csv.Error
470+
The default is :const:`False`. When combining ``delimiter=' '`` with
471+
``skipinitialspace=True``, unquoted empty fields are not allowed.
489472

490473
.. attribute:: Dialect.strict
491474

0 commit comments

Comments
 (0)