操作系统实用工具

PyObject * PyOS_FSPath ( PyObject * path )
返回值:新引用。 属于 稳定 ABI (应用程序二进制接口) since version 3.6.

返回文件系统表示为 path 。若对象是 str or bytes object, then a new 强引用 is returned. If the object implements the os.PathLike 接口,那么 __fspath__() is returned as long as it is a str or bytes object. Otherwise TypeError is raised and NULL 被返回。

Added in version 3.6.