From: Brett Cannon Date: Thu, 9 Jun 2016 21:37:06 +0000 (-0700) Subject: Clarify the os.fspath() documentation. X-Git-Tag: v3.6.0a2~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fa1aa1975491533e970413fd6c66fc8a65f0cd3;p=python Clarify the os.fspath() documentation. --- diff --git a/Doc/library/os.rst b/Doc/library/os.rst index deabaebe72..3dca86e473 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -188,11 +188,12 @@ process and user. .. function:: fspath(path) - Return the string representation of the path. + Return the file system representation of the path. If :class:`str` or :class:`bytes` is passed in, it is returned unchanged; - otherwise, the result of calling ``type(path).__fspath__`` is returned, or an - exception is raised. + otherwise, the result of calling ``type(path).__fspath__`` is returned + (which is represented by :class:`os.PathLike`). All other types raise a + :exc:`TypeError`. .. function:: getenv(key, default=None)