-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-148001: Expose shutil.ReadError and shutil.RegistryError
#148004
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,21 @@ Directory and files operations | |
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
| .. exception:: ReadError | ||
|
|
||
| This exception is raised when an archive cannot be read or is not recognized | ||
| as a supported archive format. It is raised by :func:`unpack_archive`. | ||
|
|
||
| .. versionadded:: 3.2 | ||
|
|
||
| .. exception:: RegistryError | ||
|
|
||
| This exception is raised when a registry operation with the archiving | ||
| and unpacking registries fails, such as registering a duplicate archive | ||
| format extension. It is raised by :func:`register_unpack_format`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be documented near the function that is raising it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will move this near |
||
|
|
||
| .. versionadded:: 3.2 | ||
|
|
||
|
|
||
| .. function:: copymode(src, dst, *, follow_symlinks=True) | ||
|
|
||
|
|
@@ -737,6 +752,8 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules. | |
| registered for that extension. In case none is found, | ||
| a :exc:`ValueError` is raised. | ||
|
|
||
| If the archive file cannot be read, a :exc:`ReadError` is raised. | ||
|
|
||
| The keyword-only *filter* argument is passed to the underlying unpacking | ||
| function. For zip files, *filter* is not accepted. | ||
| For tar files, it is recommended to use ``'data'`` (default since Python | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,2 @@ | ||||||||
| Add :exc:`shutil.ReadError` and :exc:`shutil.RegistryError` to | ||||||||
| ``shutil.__all__`` and document them. | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, updated |
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense to document this under the file operations. This should be documented under the unpack_* section (i.e. "Archiving operations").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll move this to the Archiving operations section near
unpack_archive().