summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Rachum <ram@rachum.com>2020-06-05 20:56:06 (GMT)
committerGitHub <noreply@github.com>2020-06-05 20:56:06 (GMT)
commit235f918f44bb89e27190db2f1823d191dbd4ad28 (patch)
tree735f5452cb079bbedf6b071f10cecb4b3ff24dae
parent161541ab45278df6603dd870113b10f13e4d9e16 (diff)
downloadcpython-235f918f44bb89e27190db2f1823d191dbd4ad28.zip
cpython-235f918f44bb89e27190db2f1823d191dbd4ad28.tar.gz
cpython-235f918f44bb89e27190db2f1823d191dbd4ad28.tar.bz2
bpo-40876: Clarify error message in the csv module (GH-20653)
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst1
-rw-r--r--Modules/_csv.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst b/Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst
new file mode 100644
index 0000000..75f62ad
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst
@@ -0,0 +1 @@
+Clarify error message in the :mod:`csv` module.
diff --git a/Modules/_csv.c b/Modules/_csv.c
index f33733a..7e44419 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -810,7 +810,7 @@ Reader_iternext(ReaderObj *self)
PyErr_Format(_csvstate_global->error_obj,
"iterator should return strings, "
"not %.200s "
- "(did you open the file in text mode?)",
+ "(the file should be opened in text mode)",
Py_TYPE(lineobj)->tp_name
);
Py_DECREF(lineobj);