home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1031275532

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1031275532 PR_kwDOAMm_X84tbs_K 5879 Check for path-like objects rather than Path type, use os.fspath 895458 closed 0     14 2021-10-20T11:05:56Z 2022-03-31T21:41:32Z 2021-10-27T22:38:21Z CONTRIBUTOR   0 pydata/xarray/pulls/5879

This PR generally changes (e.g.) isinstance(filename, pathlib.Path) to isinstance(filename, os.PathLike), and uses os.fspath to convert it to (usually) str type.

(If it is vital these are always str, then should os.fsdecode be considered? bytes paths are not common, and only possible on some platforms).

If other path-like objects are used e.g. py.path used by the tmpdir pytest fixture, an error message is shown:

ValueError: can only read bytes or file-like objects with engine='scipy' or 'h5netcdf'

This PR allows other path-like objects to be used.

A few typing objects are also adjusted too.


Be aware there are file-like and path-like object terms used in the core Python glossary. In light of this, some "file-like" wordings may need to be adjusted, such as the error message described above. This can be done in this PR if anyone aggrees.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5879/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 14 rows from issue in issue_comments
Powered by Datasette · Queries took 0.684ms · About: xarray-datasette