mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +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
|
@ -75,6 +75,18 @@ PyAPI_FUNC(void) _PyErr_SetString(
|
|||
PyObject *exception,
|
||||
const char *string);
|
||||
|
||||
/*
|
||||
* Set an exception with the error message decoded from the current locale
|
||||
* encoding (LC_CTYPE).
|
||||
*
|
||||
* Exceptions occurring in decoding take priority over the desired exception.
|
||||
*
|
||||
* Exported for '_ctypes' shared extensions.
|
||||
*/
|
||||
PyAPI_FUNC(void) _PyErr_SetLocaleString(
|
||||
PyObject *exception,
|
||||
const char *string);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyErr_Format(
|
||||
PyThreadState *tstate,
|
||||
PyObject *exception,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue