summaryrefslogtreecommitdiff
path: root/Doc/c-api/unicode.rst
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-09-06 15:50:29 -0700
committerBrett Cannon <brett@python.org>2016-09-06 15:50:29 -0700
commit6943920987d1a53b4df9ad93a01e4eb590ede3a7 (patch)
tree65dd1663f366badd10789cc1401c3a36dedb6db0 /Doc/c-api/unicode.rst
parenta6e36dc17b59768ce0308c5e03981ba96a26c469 (diff)
downloadcpython-6943920987d1a53b4df9ad93a01e4eb590ede3a7.tar.gz
Issue #26027: Support path-like objects in PyUnicode-FSConverter().
This is to add support for os.exec*() and os.spawn*() functions. Part of PEP 519.
Diffstat (limited to 'Doc/c-api/unicode.rst')
-rw-r--r--Doc/c-api/unicode.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 5383e9787f..019453fac8 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -810,13 +810,16 @@ used, passing :c:func:`PyUnicode_FSConverter` as the conversion function:
.. c:function:: int PyUnicode_FSConverter(PyObject* obj, void* result)
- ParseTuple converter: encode :class:`str` objects to :class:`bytes` using
+ ParseTuple converter: encode :class:`str` objects -- obtained directly or
+ through the :class:`os.PathLike` interface -- to :class:`bytes` using
:c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is.
*result* must be a :c:type:`PyBytesObject*` which must be released when it is
no longer used.
.. versionadded:: 3.1
+ .. versionchanged:: 3.6
+ Accepts a :term:`path-like object`.
To decode file names during argument parsing, the ``"O&"`` converter should be
used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function: