mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
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:
parent
4a4b679515
commit
d8a1447c99
14 changed files with 41 additions and 39 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue