From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 7 Nov 2025 16:26:40 +0000 (+0100) Subject: [3.14] gh-141004: Document `PyErr_WarnExplicitFormat` (GH-141187) (GH-141202) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b59832041a573615550cc0bb70cb1aebeaca34d9;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-141004: Document `PyErr_WarnExplicitFormat` (GH-141187) (GH-141202) gh-141004: Document `PyErr_WarnExplicitFormat` (GH-141187) (cherry picked from commit 9420795b47ac88f31315a8d1041e2c66c2cd9a8b) Co-authored-by: Peter Bierma --- diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 9c75f66f6831..b6f9399337eb 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -394,6 +394,15 @@ an error value). .. versionadded:: 3.2 +.. c:function:: int PyErr_WarnExplicitFormat(PyObject *category, const char *filename, int lineno, const char *module, PyObject *registry, const char *format, ...) + + Similar to :c:func:`PyErr_WarnExplicit`, but uses + :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is + an ASCII-encoded string. + + .. versionadded:: 3.2 + + .. c:function:: int PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level, const char *format, ...) Function similar to :c:func:`PyErr_WarnFormat`, but *category* is