mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
[3.12] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746) (GH-128027)
- Add a helper to set an error from locale-encoded `char*` - Use the helper for gdbm & dlerror messages Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
6ac578cf53
commit
e0b61ffa38
12 changed files with 184 additions and 69 deletions
|
@ -129,6 +129,7 @@ _pysqlite_seterror(pysqlite_state *state, sqlite3 *db)
|
|||
|
||||
/* Create and set the exception. */
|
||||
int extended_errcode = sqlite3_extended_errcode(db);
|
||||
// sqlite3_errmsg() always returns an UTF-8 encoded message
|
||||
const char *errmsg = sqlite3_errmsg(db);
|
||||
raise_exception(exc_class, extended_errcode, errmsg);
|
||||
return extended_errcode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue