mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
objects, as described in the documentation.
This commit is contained in:
parent
2f7105dde7
commit
4aae1ebab2
3 changed files with 4 additions and 6 deletions
|
@ -1005,11 +1005,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
|
|||
|
||||
if (arg == Py_None)
|
||||
*p = 0;
|
||||
else if (PyBytes_Check(arg)) {
|
||||
/* Enable null byte check below */
|
||||
uarg = arg;
|
||||
*p = PyBytes_AS_STRING(arg);
|
||||
}
|
||||
else if (PyUnicode_Check(arg)) {
|
||||
uarg = UNICODE_DEFAULT_ENCODING(arg);
|
||||
if (uarg == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue