mirror of https://github.com/python/cpython
Remove redundant check in dbm.open() (GH-111844)
PyUnicode_FSConverter() already checks for embedded null characters.
This commit is contained in:
parent
a3903c8ec8
commit
804575b5c0
|
@ -557,11 +557,6 @@ dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
|
|||
}
|
||||
|
||||
const char *name = PyBytes_AS_STRING(filenamebytes);
|
||||
if (strlen(name) != (size_t)PyBytes_GET_SIZE(filenamebytes)) {
|
||||
Py_DECREF(filenamebytes);
|
||||
PyErr_SetString(PyExc_ValueError, "embedded null character");
|
||||
return NULL;
|
||||
}
|
||||
PyObject *self = newdbmobject(state, name, iflags, mode);
|
||||
Py_DECREF(filenamebytes);
|
||||
return self;
|
||||
|
|
Loading…
Reference in New Issue