summaryrefslogtreecommitdiffstats
path: root/Doc/library/os.rst
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-06-09 21:37:06 (GMT)
committerBrett Cannon <brett@python.org>2016-06-09 21:37:06 (GMT)
commit0fa1aa1975491533e970413fd6c66fc8a65f0cd3 (patch)
tree0ee654bd1c8bb35ec2cdaea1a59c91869fe48043 /Doc/library/os.rst
parentb4f43e90d9a01b0e53f1b1b335f4946af6c193b1 (diff)
downloadcpython-0fa1aa1975491533e970413fd6c66fc8a65f0cd3.zip
cpython-0fa1aa1975491533e970413fd6c66fc8a65f0cd3.tar.gz
cpython-0fa1aa1975491533e970413fd6c66fc8a65f0cd3.tar.bz2
Clarify the os.fspath() documentation.
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r--Doc/library/os.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index deabaeb..3dca86e 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)