-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Open
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
skipinitialspace=True
and delimiter=' '
raise an exception for an unquoted blank field:
The docs do not mention this behavior:
Simple demonstration:
>>> import csv, io
>>> buf = io.StringIO()
>>> w = csv.writer(buf, delimiter=' ', skipinitialspace=True, quoting=csv.QUOTE_NONE)
>>> w.writerow(['', 'x'])
Traceback (most recent call last):
File "<python-input-3>", line 1, in <module>
w.writerow(['', 'x'])
~~~~~~~~~~^^^^^^^^^^^
_csv.Error: empty field must be quoted if delimiter is a space and skipinitialspace is true
This is since gh-115721. The behavior is intentional and the docs should be updated.
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
No status
Status
Todo