From 25e68fedc377d16176faa5a7653f3cda2eb19754 Mon Sep 17 00:00:00 2001 From: Tom Coleman <15375218+ColemanTom@users.noreply.github.com> Date: Wed, 15 Mar 2023 11:49:05 +1100 Subject: [PATCH 1/3] Raise PermissionError when insufficient permissions --- xarray/backends/plugins.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xarray/backends/plugins.py b/xarray/backends/plugins.py index bae1dcd2225..d6ad6dfbe18 100644 --- a/xarray/backends/plugins.py +++ b/xarray/backends/plugins.py @@ -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) From c7bac027aaeaa73c2ecff15123687094d2a0a22c Mon Sep 17 00:00:00 2001 From: Tom Coleman <15375218+ColemanTom@users.noreply.github.com> Date: Wed, 15 Mar 2023 11:57:35 +1100 Subject: [PATCH 2/3] Update whats-new.rst --- doc/whats-new.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 6bfdf0b6f0a..7d13b0b0470 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -98,6 +98,8 @@ Bug fixes By `Paul Ockenfuß `_. - Fix :py:meth:`DataArray.plot.pcolormesh` which now works if one of the coordinates has str dtype (:issue:`6775`, :pull:`7612`). By `Michael Niklas `_. +- Improve error message when trying to open a file which you do not have permission to read (:issue:`6523`, :pull:`7629`). + By `Thomas Coleman `_. Documentation ~~~~~~~~~~~~~ From 9bb23d9e9f4c53c05259b0832c4ecb5042078911 Mon Sep 17 00:00:00 2001 From: dcherian Date: Sun, 26 Mar 2023 14:00:56 -0600 Subject: [PATCH 3/3] Update whats-new --- doc/whats-new.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 7d13b0b0470..c4c9097ab0a 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -37,6 +37,8 @@ Bug fixes - Fix :py:meth:`xr.polyval` with non-system standard integer coeffs (:pull:`7619`). By `Shreyal Gupta `_ and `Michael Niklas `_. +- Improve error message when trying to open a file which you do not have permission to read (:issue:`6523`, :pull:`7629`). + By `Thomas Coleman `_. Documentation ~~~~~~~~~~~~~ @@ -98,8 +100,6 @@ Bug fixes By `Paul Ockenfuß `_. - Fix :py:meth:`DataArray.plot.pcolormesh` which now works if one of the coordinates has str dtype (:issue:`6775`, :pull:`7612`). By `Michael Niklas `_. -- Improve error message when trying to open a file which you do not have permission to read (:issue:`6523`, :pull:`7629`). - By `Thomas Coleman `_. Documentation ~~~~~~~~~~~~~