]> granicus.if.org Git - python/commitdiff
Issue #27186: Document PyOS_FSPath().
authorBrett Cannon <brett@python.org>
Thu, 9 Jun 2016 23:58:38 +0000 (16:58 -0700)
committerBrett Cannon <brett@python.org>
Thu, 9 Jun 2016 23:58:38 +0000 (16:58 -0700)
Doc/c-api/sys.rst
Doc/data/refcounts.dat

index 9ba649624797f37535cbf44a1863f3187779714e..f3cde8c573ae6745f8e6ff35ba65bf94a988039b 100644 (file)
@@ -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)
 
index e3881957579441a84bebdbb44362ec342cb49fb8..8b469f4aac9a489ff12a1fe9a9870f456057d723 100644 (file)
@@ -921,6 +921,9 @@ PyNumber_Xor:PyObject*:o2:0:
 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: