8000 bpo-41638: Improve ProgrammingError message for absent parameter. by serhiy-storchaka · Pull Request #21999 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-41638: Improve ProgrammingError message for absent parameter. #21999

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-41638: Improve ProgrammingError message for absent parameter.
It contains now the name of the parameter instead of its index when parameters
are supplied as a dict.
  • Loading branch information
serhiy-storchaka committed Aug 29, 2020
commit 9819b6fc8e02d964911d391ef784eb0c9ada84d3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ProgrammingError message for absent parameter in :mod:`sqlite3`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProgrammingError -> :exc:`sqlite3.ProgrammingError`

contains now the name of the parameter instead of its index when parameters
are supplied as a dict.
2 changes: 1 addition & 1 deletion Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
Py_DECREF(binding_name_obj);
if (!current_param) {
if (!PyErr_Occurred() || PyErr_ExceptionMatches(PyExc_LookupError)) {
PyErr_Format(pysqlite_ProgrammingError, "You did not supply a value for binding %d.", i);
PyErr_Format(pysqlite_ProgrammingError, "You did not supply a value for binding parameter :%s.", binding_name);
}
return;
}
Expand Down
0