File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed
Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments