diff options
author | Bénédikt Tran <10796600+picnixz@users.noreply.github.com> | 2024-12-17 12:12:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 12:12:45 +0100 |
commit | 7303f06846b69016a075bca7ad7c6055f29ad024 (patch) | |
tree | fa3abb9f0a3b3b18bbd60590cbfb1c3c6a91d70f /Modules/_sqlite/util.c | |
parent | b9a492b809d8765ee365a5dd3c6ba4e5130a80af (diff) | |
download | cpython-7303f06846b69016a075bca7ad7c6055f29ad024.tar.gz cpython-7303f06846b69016a075bca7ad7c6055f29ad024.zip |
gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746)
- 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>
Diffstat (limited to 'Modules/_sqlite/util.c')
-rw-r--r-- | Modules/_sqlite/util.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c index 9e8613ef679..b0622e66928 100644 --- a/Modules/_sqlite/util.c +++ b/Modules/_sqlite/util.c @@ -134,6 +134,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; |