diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index c31ff6543aee52..88e8756cf84a53 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -708,6 +708,10 @@ call fails (for example because the path doesn't exist). >>> Path.home() PosixPath('/home/antoine') + Note that unlike :func:`os.path.expanduser`, on POSIX systems a + :exc:`KeyError` or :exc:`RuntimeError` will be raised, and on Windows systems a + :exc:`RuntimeError` will be raised if home directory can't be resolved. + .. versionadded:: 3.5 @@ -764,6 +768,10 @@ call fails (for example because the path doesn't exist). >>> p.expanduser() PosixPath('/home/eric/films/Monty Python') + Note that unlike :func:`os.path.expanduser`, on POSIX systems a + :exc:`KeyError` or :exc:`RuntimeError` will be raised, and on Windows systems a + :exc:`RuntimeError` will be raised if home directory can't be resolved. + .. versionadded:: 3.5