summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/unicode.rst
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-09-07 02:36:01 (GMT)
committerBrett Cannon <brett@python.org>2016-09-07 02:36:01 (GMT)
commita571120410bf7a92ca612068cf1a754d5dca614e (patch)
tree875c341f44dfbf0cc486c40170af17f300eead44 /Doc/c-api/unicode.rst
parenta439191efa9fee12ea3c17b23b0d3f748ff76997 (diff)
downloadcpython-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/unicode.rst')
-rw-r--r--Doc/c-api/unicode.rst12
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)