gh-148001: Expose shutil.ReadError and shutil.RegistryError#148004
gh-148001: Expose shutil.ReadError and shutil.RegistryError#148004WYSIATI wants to merge 3 commits intopython:mainfrom
shutil.ReadError and shutil.RegistryError#148004Conversation
1912758 to
37e2888
Compare
…d document them Both exceptions are raised by public API functions (unpack_archive() and register_unpack_format()) but were never included in __all__ when they were introduced in Python 3.2.
Use ``shutil.__all__`` instead of :data:`shutil.__all__` to avoid Sphinx ref.data warning.
37e2888 to
e6d6cdb
Compare
picnixz
left a comment
There was a problem hiding this comment.
Please also indicate that register_* may raise.
Doc/library/shutil.rst
Outdated
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
| .. exception:: ReadError |
There was a problem hiding this comment.
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.
Good point, I'll move this to the Archiving operations section near unpack_archive().
| Add :exc:`shutil.ReadError` and :exc:`shutil.RegistryError` to | ||
| ``shutil.__all__`` and document them. |
There was a problem hiding this comment.
| Add :exc:`shutil.ReadError` and :exc:`shutil.RegistryError` to | |
| ``shutil.__all__`` and document them. | |
| Publicly expose :exc:`shutil.ReadError` and :exc:`shutil.RegistryError`. |
Doc/library/shutil.rst
Outdated
|
|
||
| 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`. |
There was a problem hiding this comment.
This should be documented near the function that is raising it.
There was a problem hiding this comment.
Will move this near register_unpack_format() and add a note that it raises RegistryError
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
shutil.ReadError and shutil.RegistryError
Will do — I'll add a note to |
- Move ReadError docs near unpack_archive() - Move RegistryError docs near register_unpack_format() - Add note that register_unpack_format() raises RegistryError - Simplify NEWS entry
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @picnixz: please review the changes made to this pull request. |
ReadErrorandRegistryErrorwere added in Python 3.2 but never included inshutil.__all__or documented. Both are raised by public API functions (unpack_archive()andregister_unpack_format()), so they should be discoverable and importable via wildcard import.This PR adds them to
__all__, documents them inshutil.rst, and updates the existing__all__test.shutil.ReadErrorandshutil.RegistryError#148001