Skip to content

Commit 3c46609

Browse files
committed
Document PyBytes_DecodeEscape()
1 parent 8c0f2f8 commit 3c46609

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Doc/c-api/bytes.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,22 @@ called with a non-bytes parameter.
245245
returns ``NULL`` with an exception set.
246246
247247
248+
.. c:function:: PyObject *PyBytes_DecodeEscape(const char *s, Py_ssize_t len, const char *errors, Py_ssize_t unicode, const char *recode_encoding)
249+
250+
Unescape a backslash-escaped string *s*. *s* must not be ``NULL``.
251+
*len* must be the size of *s*.
252+
253+
*errors* must be one of ``"strict"``, ``"replace"``, or ``"ignore"``. If
254+
*errors* is ``NULL``, then ``"strict"`` is used by default.
255+
256+
On success, this function returns a :term:`strong reference` to a Python
257+
:class:`bytes` object containing the unescaped string. On failure, this
258+
function returns ``NULL`` with an exception set.
259+
260+
.. versionchanged:: 3.9
261+
*unicode* and *recode_encoding* are now unused.
262+
263+
248264
.. _pybyteswriter:
249265
250266
PyBytesWriter

0 commit comments

Comments
 (0)