From: Ram Rachum Date: Fri, 5 Jun 2020 20:56:06 +0000 (+0300) Subject: bpo-40876: Clarify error message in the csv module (GH-20653) X-Git-Tag: v3.10.0a1~710 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=235f918f44bb89e27190db2f1823d191dbd4ad28;p=thirdparty%2FPython%2Fcpython.git bpo-40876: Clarify error message in the csv module (GH-20653) --- 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 000000000000..75f62addbabb --- /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 f33733aaf850..7e44419c0876 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);