mirror of https://github.com/python/cpython.git
[3.9] bpo-41082: Add note on errors that may be raised by home() and expanduser() (GH-28186)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
7a6178a7cd
commit
dc2e11ed5a
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue