id,node_id,number,state,locked,title,user,body,created_at,updated_at,closed_at,merged_at,merge_commit_sha,assignee,milestone,draft,head,base,author_association,auto_merge,repo,url,merged_by
1043204734,PR_kwDOAMm_X84-Lgp-,6974,closed,0,"Ensure encoding[""source""] is available for a pathlib.Path object",15375218,"Closes #5888. At the moment if you pass a `Path` object, the `source` will not be encoded in, only if a string is passed in. Given there is already a function to handle this, `_normalize_path`, I've simplified the logic to just run that over the `str/Path` to ensure it is always encoded.

<!-- Feel free to remove check-list items aren't relevant to your change -->

- [x] Closes #5888
- [x] Tests added
- [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst`

I'm not sure if this needs including in the `whats-new.rst`. I'm happy to add it if desired.
",2022-09-01T04:52:42Z,2023-03-01T19:12:12Z,2022-09-13T07:17:39Z,2022-09-13T07:17:39Z,e00e51f42ed382cf22cbbea7e8a8c961f05f9045,,,0,2bb541b0ce7b2a495bc349fb28c8cec5f6783880,b018442c8dfa3e71ec35e294de69e2011949afec,CONTRIBUTOR,"{""enabled_by"": {""login"": ""mathause"", ""id"": 10194086, ""node_id"": ""MDQ6VXNlcjEwMTk0MDg2"", ""avatar_url"": ""https://avatars.githubusercontent.com/u/10194086?v=4"", ""gravatar_id"": """", ""url"": ""https://api.github.com/users/mathause"", ""html_url"": ""https://github.com/mathause"", ""followers_url"": ""https://api.github.com/users/mathause/followers"", ""following_url"": ""https://api.github.com/users/mathause/following{/other_user}"", ""gists_url"": ""https://api.github.com/users/mathause/gists{/gist_id}"", ""starred_url"": ""https://api.github.com/users/mathause/starred{/owner}{/repo}"", ""subscriptions_url"": ""https://api.github.com/users/mathause/subscriptions"", ""organizations_url"": ""https://api.github.com/users/mathause/orgs"", ""repos_url"": ""https://api.github.com/users/mathause/repos"", ""events_url"": ""https://api.github.com/users/mathause/events{/privacy}"", ""received_events_url"": ""https://api.github.com/users/mathause/received_events"", ""type"": ""User"", ""site_admin"": false}, ""merge_method"": ""squash"", ""commit_title"": ""Ensure encoding[\""source\""] is available for a pathlib.Path object (#6974)"", ""commit_message"": ""* Ensure 'source' is encoded even when its a Path\r\n\r\nResolves Issue #5888.\r\n\r\nWith this change, the \""source\"" encoding will be stored whether the filename is\r\na string or a Path object.\r\n\r\n* Add a test for encoding source with Path object\r\n\r\n* Update whats-new.rst\r\n\r\n* Ensure only string and Path filenames encode source\r\n\r\nCo-authored-by: Mathias Hauser <mathause@users.noreply.github.com>\r\n\r\n* Update doc/whats-new.rst\r\n\r\n* fix link\r\n\r\nCo-authored-by: Mathias Hauser <mathause@users.noreply.github.com>\r\nCo-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>""}",13221727,https://github.com/pydata/xarray/pull/6974,
1275970795,PR_kwDOAMm_X85MDcTr,7629,closed,0,Raise PermissionError when insufficient permissions,15375218,"- [x] Closes #6523
- [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst`

### Previously

```bash
(xr) $ chmod 000 testfile.nc
(xr) $ python -c 'import xarray as xr
f=xr.open_dataarray(""testfile.nc"").load()'
MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/plugins.py:139: RuntimeWarning: 'netcdf4' fails while guessing
  warnings.warn(f""{engine!r} fails while guessing"", RuntimeWarning)
MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/plugins.py:148: RuntimeWarning: 'netcdf4' fails while guessing
  warnings.warn(f""{engine!r} fails while guessing"", RuntimeWarning)
MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/plugins.py:148: RuntimeWarning: 'h5netcdf' fails while guessing
  warnings.warn(f""{engine!r} fails while guessing"", RuntimeWarning)
MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/plugins.py:148: RuntimeWarning: 'scipy' fails while guessing
  warnings.warn(f""{engine!r} fails while guessing"", RuntimeWarning)
Traceback (most recent call last):
  File ""<string>"", line 2, in <module>
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/api.py"", line 687, in open_dataarray
    dataset = open_dataset(
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/api.py"", line 510, in open_dataset
    engine = plugins.guess_engine(filename_or_obj)
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/plugins.py"", line 177, in guess_engine
    raise ValueError(error_msg)
ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:
https://docs.xarray.dev/en/stable/getting-started-guide/installing.html
https://docs.xarray.dev/en/stable/user-guide/io.html
```

### Now

```bash
(xr) $ chmod 000 testfile.nc
(xr) $ python -c 'import xarray as xr
f=xr.open_dataarray(""testfile.nc"").load()'
Traceback (most recent call last):
  File ""<string>"", line 2, in <module>
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/api.py"", line 687, in open_dataarray
    dataset = open_dataset(
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/api.py"", line 510, in open_dataset
    engine = plugins.guess_engine(filename_or_obj)
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/plugins.py"", line 136, in guess_engine
    if backend.guess_can_open(store_spec):
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/backends/netCDF4_.py"", line 547, in guess_can_open
    magic_number = try_read_magic_number_from_path(filename_or_obj)
  File ""MY_HOME/miniconda3/envs/xr/lib/python3.9/site-packages/xarray/core/utils.py"", line 673, in try_read_magic_number_from_path
    with open(path, ""rb"") as f:
PermissionError: [Errno 13] Permission denied: 'testfile.nc'
```",2023-03-15T00:56:58Z,2023-03-26T20:30:32Z,2023-03-26T20:30:31Z,2023-03-26T20:30:31Z,86f3f21ab3d0dff6fdb4a0bccd27c62f9e4a3238,,,0,9bb23d9e9f4c53c05259b0832c4ecb5042078911,1e361ccb9123fe25acfd9e3364c911c1eec7d9db,CONTRIBUTOR,"{""enabled_by"": {""login"": ""dcherian"", ""id"": 2448579, ""node_id"": ""MDQ6VXNlcjI0NDg1Nzk="", ""avatar_url"": ""https://avatars.githubusercontent.com/u/2448579?v=4"", ""gravatar_id"": """", ""url"": ""https://api.github.com/users/dcherian"", ""html_url"": ""https://github.com/dcherian"", ""followers_url"": ""https://api.github.com/users/dcherian/followers"", ""following_url"": ""https://api.github.com/users/dcherian/following{/other_user}"", ""gists_url"": ""https://api.github.com/users/dcherian/gists{/gist_id}"", ""starred_url"": ""https://api.github.com/users/dcherian/starred{/owner}{/repo}"", ""subscriptions_url"": ""https://api.github.com/users/dcherian/subscriptions"", ""organizations_url"": ""https://api.github.com/users/dcherian/orgs"", ""repos_url"": ""https://api.github.com/users/dcherian/repos"", ""events_url"": ""https://api.github.com/users/dcherian/events{/privacy}"", ""received_events_url"": ""https://api.github.com/users/dcherian/received_events"", ""type"": ""User"", ""site_admin"": false}, ""merge_method"": ""squash"", ""commit_title"": ""Raise PermissionError when insufficient permissions (#7629)"", ""commit_message"": ""* Raise PermissionError when insufficient permissions\r\n\r\n* Update whats-new.rst\r\n\r\n* Update whats-new\r\n\r\n---------\r\n\r\nCo-authored-by: dcherian <deepak@cherian.net>""}",13221727,https://github.com/pydata/xarray/pull/7629,