summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-06-09 23:58:38 (GMT)
committerBrett Cannon <brett@python.org>2016-06-09 23:58:38 (GMT)
commit746102bd238f414ba65b336d600eade06b99c440 (patch)
tree1774f397ad216d816f6d8f2e57ca75ebd23365d7 /Doc/c-api
parentb08388d5f2e62577e1a2379deb1681af4f148811 (diff)
downloadcpython-746102bd238f414ba65b336d600eade06b99c440.zip
cpython-746102bd238f414ba65b336d600eade06b99c440.tar.gz
cpython-746102bd238f414ba65b336d600eade06b99c440.tar.bz2
Issue #27186: Document PyOS_FSPath().
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/sys.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst
index 9ba6496..f3cde8c 100644
--- a/Doc/c-api/sys.rst
+++ b/Doc/c-api/sys.rst
@@ -5,6 +5,16 @@
Operating System Utilities
==========================
+.. c:function:: PyObject* PyOS_FSPath(PyObject *path)
+
+ Return the file system representation for *path*. If the object is a
+ :class:`str` or :class:`bytes` object, then its reference count is
+ incremented. If the object implements the :class:`os.PathLike` interface,
+ then ``type(path).__fspath__()`` is returned. Otherwise :exc:`TypeError` is
+ raised and ``NULL`` is returned.
+
+ .. versionadded:: 3.6
+
.. c:function:: int Py_FdIsInteractive(FILE *fp, const char *filename)