diff options
author | Brett Cannon <brett@python.org> | 2016-09-07 02:36:01 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-09-07 02:36:01 (GMT) |
commit | a571120410bf7a92ca612068cf1a754d5dca614e (patch) | |
tree | 875c341f44dfbf0cc486c40170af17f300eead44 /Doc/c-api | |
parent | a439191efa9fee12ea3c17b23b0d3f748ff76997 (diff) | |
download | cpython-a571120410bf7a92ca612068cf1a754d5dca614e.zip cpython-a571120410bf7a92ca612068cf1a754d5dca614e.tar.gz cpython-a571120410bf7a92ca612068cf1a754d5dca614e.tar.bz2 |
Issue #27182: Add support for path-like objects to PyUnicode_FSDecoder().
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/unicode.rst | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 019453f..55ef575 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -826,13 +826,17 @@ used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function: .. c:function:: int PyUnicode_FSDecoder(PyObject* obj, void* result) - ParseTuple converter: decode :class:`bytes` objects to :class:`str` using - :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output - as-is. *result* must be a :c:type:`PyUnicodeObject*` which must be released - when it is no longer used. + ParseTuple converter: decode :class:`bytes` objects -- obtained either + directly or indirectly through the :class:`os.PathLike` interface -- to + :class:`str` using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` + objects are output as-is. *result* must be a :c:type:`PyUnicodeObject*` which + must be released when it is no longer used. .. versionadded:: 3.2 + .. versionchanged:: 3.6 + Accepts a :term:`path-like object`. + .. c:function:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) |