home / github / pull_requests

Menu
  • Search all tables
  • GraphQL API

pull_requests: 863479168

This data as json

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
863479168 PR_kwDOAMm_X84zd6WA 6305 closed 0 On Windows, enable successful test of opening a dataset containing a cftime index 38358698 - [X] User visible changes (including notable bug fixes) are documented in `whats-new.rst` Previously, on Windows, the subject test unnecessarily failed, and the temporary directory and file remained, because the scheduler in the outer context prevented deleting the temporary directory upon exiting the inner context of the latter. <details><summary>Example failure (with short traceback):</summary> <p> ``` ================================================ FAILURES ================================================= __________________________ test_open_mfdataset_can_open_files_with_cftime_index ___________________________ C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:616: in _rmtree_unsafe os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\STAN~1.WES\\AppData\\Local\\Temp\\tmpdpdajrgc\\test.nc' During handling of the above exception, another exception occurred: C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:802: in onerror _os.unlink(path) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\STAN~1.WES\\AppData\\Local\\Temp\\tmpdpdajrgc\\test.nc' During handling of the above exception, another exception occurred: C:\Users\stan.west\Documents\Repositories\xarray\xarray\tests\test_distributed.py:128: in test_open_mfdataset_can_open_files_with_cftime_index assert_identical(tf["test"], da) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:827: in __exit__ self.cleanup() C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:831: in cleanup self._rmtree(self.name) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:813: in _rmtree _shutil.rmtree(name, onerror=onerror) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:740: in rmtree return _rmtree_unsafe(path, onerror) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:618: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:805: in onerror cls._rmtree(path) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:813: in _rmtree _shutil.rmtree(name, onerror=onerror) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:740: in rmtree return _rmtree_unsafe(path, onerror) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:599: in _rmtree_unsafe onerror(os.scandir, path, sys.exc_info()) C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:596: in _rmtree_unsafe with os.scandir(path) as scandir_it: E NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\STAN~1.WES\\AppData\\Local\\Temp\\tmpdpdajrgc\\test.nc' ========================================= short test summary info ========================================= FAILED xarray/tests/test_distributed.py::test_open_mfdataset_can_open_files_with_cftime_index - NotADirec... =========================================== 1 failed in 10.77s ============================================ ``` </p> </details> The first commit swaps the two contexts to resolve the issue. The second commit replaces the `tempfile.TemporaryDirectory()` context manager with *pytest*'s `tmp_path` fixture, which slightly simplifies the test and relies on *pytest* to remove the directory on a subsequent invocation. 2022-02-25T14:07:50Z 2022-02-28T16:06:33Z 2022-02-28T09:53:22Z 2022-02-28T09:53:22Z 613a8fda4f07181fbc41d6ff2296fec3726fd351     0 3337833f44172f823a7174eb363f5cb3484a56af de965f342e1c9c5de92ab135fbc4062e21e72453 CONTRIBUTOR   13221727 https://github.com/pydata/xarray/pull/6305  

Links from other tables

  • 1 row from pull_requests_id in labels_pull_requests
Powered by Datasette · Queries took 0.892ms