Issue #22215: Now ValueError is raised instead of TypeError when str or bytes

argument contains not permitted null character or byte.
This commit is contained in:
Serhiy Storchaka 2014-09-06 20:07:17 +03:00
parent 4a4b679515
commit d8a1447c99
14 changed files with 41 additions and 39 deletions

View file

@ -903,7 +903,7 @@ path_converter(PyObject *o, void *p) {
narrow = PyBytes_AS_STRING(bytes);
if ((size_t)length != strlen(narrow)) {
FORMAT_EXCEPTION(PyExc_ValueError, "embedded NUL character in %s");
FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
Py_DECREF(bytes);
return 0;
}