html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/pull/7880#issuecomment-1572359754,https://api.github.com/repos/pydata/xarray/issues/7880,1572359754,IC_kwDOAMm_X85duE5K,43316012,2023-06-01T16:23:45Z,2023-06-01T16:23:45Z,COLLABORATOR,"Maybe you can add a test that creates a cachingFilemanager object, then deletes it, then run `gc.collect()` and check somehow if it works? But no idea how pytest interferes with this or how you can ensure that there are no references to the module anymore?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1730664352 https://github.com/pydata/xarray/pull/7880#issuecomment-1567450094,https://api.github.com/repos/pydata/xarray/issues/7880,1567450094,IC_kwDOAMm_X85dbWPu,43316012,2023-05-29T19:28:21Z,2023-05-29T19:28:21Z,COLLABORATOR,"> I think this is intended (though certainly not very easy to get right): see the second part of the [warning in the `__del__` documentation](https://docs.python.org/3/reference/datamodel.html#object.__del__). You are right, that warning is exactly what is causing the issues.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1730664352 https://github.com/pydata/xarray/pull/7880#issuecomment-1567439206,https://api.github.com/repos/pydata/xarray/issues/7880,1567439206,IC_kwDOAMm_X85dbTlm,43316012,2023-05-29T19:09:41Z,2023-05-29T19:09:41Z,COLLABORATOR,"That's quite a weird bug. I would have thought that the global (or module level here) variable/function aquire should have at least one reference until after the deletion of the object. Is that a bug in pythons garbage collection? Or does the garbage collection already start when calling `del` and does not wait for the completion of the `__del__` method?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1730664352