Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-89812: Add pathlib.UnsupportedOperation #105926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweak docs
  • Loading branch information
barneygale committed Jun 21, 2023
commit b3aed1f0961e7e4a5d0ee5df55b429b240c40630
34 changes: 19 additions & 15 deletions 34 Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ Exceptions
unsupported operation is called on a path object.

.. versionadded:: 3.13
This exception class. In earlier versions of pathlib,
:exc:`NotImplementedError` is raised instead.


.. _pure-paths:
Expand Down Expand Up @@ -965,8 +963,9 @@ call fails (for example because the path doesn't exist).
Return the name of the group owning the file. :exc:`KeyError` is raised
if the file's gid isn't found in the system database.

If the :mod:`grp` module is not available, this method raises
:exc:`UnsupportedOperation`.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`grp` module is not
available. In previous versions, :exc:`NotImplementedError` was raised.


.. method:: Path.is_dir()
Expand Down Expand Up @@ -1226,8 +1225,9 @@ call fails (for example because the path doesn't exist).
Return the name of the user owning the file. :exc:`KeyError` is raised
if the file's uid isn't found in the system database.

If the :mod:`pwd` module is not available, this method raises
:exc:`UnsupportedOperation`.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`pwd` module is not
available. In previous versions, :exc:`NotImplementedError` was raised.


.. method:: Path.read_bytes()
Expand Down Expand Up @@ -1269,11 +1269,12 @@ call fails (for example because the path doesn't exist).
>>> p.readlink()
PosixPath('setup.py')

If :func:`os.readlink` is not available, this method raises
:exc:`UnsupportedOperation`.

.. versionadded:: 3.9

.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if :func:`os.readlink` is not
available. In previous versions, :exc:`NotImplementedError` was raised.


.. method:: Path.rename(target)

Expand Down Expand Up @@ -1432,26 +1433,29 @@ call fails (for example because the path doesn't exist).
>>> p.lstat().st_size
8

If :func:`os.symlink` is not available, this method raises
:exc:`UnsupportedOperation`.

.. note::
The order of arguments (link, target) is the reverse
of :func:`os.symlink`'s.

.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if :func:`os.symlink` is not
available. In previous versions, :exc:`NotImplementedError` was raised.


.. method:: Path.hardlink_to(target)

Make this path a hard link to the same file as *target*.

If :func:`os.link` is not available, this method raises
:exc:`UnsupportedOperation`.

.. note::
The order of arguments (link, target) is the reverse
of :func:`os.link`'s.

.. versionadded:: 3.10

.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if :func:`os.link` is not
available. In previous versions, :exc:`NotImplementedError` was raised.


.. method:: Path.touch(mode=0o666, exist_ok=True)

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.