mirror of
https://github.com/python/cpython.git
synced 2025-07-18 16:55:20 +00:00
gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)
This commit is contained in:
parent
dd53b79de0
commit
aab01e3524
10 changed files with 65 additions and 21 deletions
|
@ -1858,7 +1858,7 @@ _Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyComp
|
|||
}
|
||||
|
||||
if (strlen(str) != (size_t)size) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
PyErr_SetString(PyExc_SyntaxError,
|
||||
"source code string cannot contain null bytes");
|
||||
Py_CLEAR(*cmd_copy);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue