summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-06-24 19:03:43 (GMT)
committerBrett Cannon <brett@python.org>2016-06-24 19:03:43 (GMT)
commitc78ca1e044b7ca4c1764bb3670196e72351d4467 (patch)
tree3435d7babe85991192e645d12c9ec2b24b4de04f /Doc/c-api
parent19b2a53a82c8f4d179efdc39fb39f766191cac2b (diff)
downloadcpython-c78ca1e044b7ca4c1764bb3670196e72351d4467.zip
cpython-c78ca1e044b7ca4c1764bb3670196e72351d4467.tar.gz
cpython-c78ca1e044b7ca4c1764bb3670196e72351d4467.tar.bz2
Issue #27186: Update os.fspath()/PyOS_FSPath() to check the return
type of __fspath__(). As part of this change, also make sure that the pure Python implementation of os.fspath() is tested.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/sys.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst
index f3cde8c..035cdc1 100644
--- a/Doc/c-api/sys.rst
+++ b/Doc/c-api/sys.rst
@@ -10,8 +10,9 @@ Operating System Utilities
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.
+ then :meth:`~os.PathLike.__fspath__` is returned as long as it is a
+ :class:`str` or :class:`bytes` object. Otherwise :exc:`TypeError` is raised
+ and ``NULL`` is returned.
.. versionadded:: 3.6