Skip to content

Commit 746102b

Browse files
committed
Issue python#27186: Document PyOS_FSPath().
1 parent b08388d commit 746102b

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/c-api/sys.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
Operating System Utilities
66
==========================
77

8+
.. c:function:: PyObject* PyOS_FSPath(PyObject *path)
9+
10+
Return the file system representation for *path*. If the object is a
11+
:class:`str` or :class:`bytes` object, then its reference count is
12+
incremented. If the object implements the :class:`os.PathLike` interface,
13+
then ``type(path).__fspath__()`` is returned. Otherwise :exc:`TypeError` is
14+
raised and ``NULL`` is returned.
15+
16+
.. versionadded:: 3.6
17+
818
919
.. c:function:: int Py_FdIsInteractive(FILE *fp, const char *filename)
1020

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,9 @@ PyNumber_Xor:PyObject*:o2:0:
921921
PyObject_AsFileDescriptor:int:::
922922
PyObject_AsFileDescriptor:PyObject*:o:0:
923923

924+
PyOS_FSPath:PyObject*::+1:
925+
PyOS_FSPath:PyObject*:path:0:
926+
924927
PyObject_Call:PyObject*::+1:
925928
PyObject_Call:PyObject*:callable_object:0:
926929
PyObject_Call:PyObject*:args:0:

0 commit comments

Comments
 (0)