[Python-checkins] cpython: Issue #27186: Document PyOS_FSPath().

brett.cannon python-checkins at python.org
Thu Jun 9 19:59:19 EDT 2016


https://hg.python.org/cpython/rev/cec1f00c538d
changeset:   101833:cec1f00c538d
parent:      101829:6239673d5e1d
user:        Brett Cannon <brett at python.org>
date:        Thu Jun 09 16:58:38 2016 -0700
summary:
  Issue #27186: Document PyOS_FSPath().

files:
  Doc/c-api/sys.rst      |  10 ++++++++++
  Doc/data/refcounts.dat |   3 +++
  2 files changed, 13 insertions(+), 0 deletions(-)


diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst
--- 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)
 
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -921,6 +921,9 @@
 PyObject_AsFileDescriptor:int:::
 PyObject_AsFileDescriptor:PyObject*:o:0:
 
+PyOS_FSPath:PyObject*::+1:
+PyOS_FSPath:PyObject*:path:0:
+
 PyObject_Call:PyObject*::+1:
 PyObject_Call:PyObject*:callable_object:0:
 PyObject_Call:PyObject*:args:0:

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list