mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +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
|
@ -1273,7 +1273,7 @@ idna_converter(PyObject *obj, struct maybe_idna *data)
|
|||
}
|
||||
if (strlen(data->buf) != len) {
|
||||
Py_CLEAR(data->obj);
|
||||
PyErr_SetString(PyExc_TypeError, "host name must not contain NUL character");
|
||||
PyErr_SetString(PyExc_TypeError, "host name must not contain null character");
|
||||
return 0;
|
||||
}
|
||||
return Py_CLEANUP_SUPPORTED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue