aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLicht Takeuchi <licht-t@outlook.jp>2017-12-12 18:57:06 +0900
committerSerhiy Storchaka <storchaka@gmail.com>2017-12-12 11:57:06 +0200
commit2001900b0c02a397d8cf1d776a7cc7fcb2a463e3 (patch)
tree87317ebf9cebe56052aa7d913f816903604b4c54 /Modules/_csv.c
parentFix small typo in tupleobject.h (#4801) (diff)
downloadcpython-2001900b0c02a397d8cf1d776a7cc7fcb2a463e3.tar.gz
cpython-2001900b0c02a397d8cf1d776a7cc7fcb2a463e3.tar.bz2
cpython-2001900b0c02a397d8cf1d776a7cc7fcb2a463e3.zip
bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)
This allows to distinguish an empty row from a row consisting of a single empty field.
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r--Modules/_csv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 5314ef6edc4..e616151bae6 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -1238,7 +1238,7 @@ csv_writerow(WriterObj *self, PyObject *seq)
if (PyErr_Occurred())
return NULL;
- if (self->num_fields > 0 && self->rec_size == 0) {
+ if (self->num_fields > 0 && self->rec_len == 0) {
if (dialect->quoting == QUOTE_NONE) {
PyErr_Format(_csvstate_global->error_obj,
"single empty field record must be quoted");