Skip to content

Commit

Permalink
Raise PermissionError when insufficient permissions (#7629)
Browse files Browse the repository at this point in the history
* Raise PermissionError when insufficient permissions

* Update whats-new.rst

* Update whats-new

---------

Co-authored-by: dcherian <[email protected]>
  • Loading branch information
ColemanTom and dcherian authored Mar 26, 2023
1 parent a28e9b5 commit 86f3f21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Bug fixes

- Fix :py:meth:`xr.polyval` with non-system standard integer coeffs (:pull:`7619`).
By `Shreyal Gupta <https://github.com/Ravenin7>`_ and `Michael Niklas <https://github.com/headtr1ck>`_.
- Improve error message when trying to open a file which you do not have permission to read (:issue:`6523`, :pull:`7629`).
By `Thomas Coleman <https://github.com/ColemanTom>`_.

Documentation
~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions xarray/backends/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def guess_engine(
try:
if backend.guess_can_open(store_spec):
return engine
except PermissionError:
raise
except Exception:
warnings.warn(f"{engine!r} fails while guessing", RuntimeWarning)

Expand Down

0 comments on commit 86f3f21

Please sign in to comment.