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/6974#issuecomment-1450715249,https://api.github.com/repos/pydata/xarray/issues/6974,1450715249,IC_kwDOAMm_X85WeChx,19718721,2023-03-01T19:12:12Z,2023-03-01T19:12:12Z,NONE,"It would be great to further improve this by handling file-like objects. I am running into an issue when trying to read some data from S3 buckets. I can pass in a file-like object and read the data, but there is no `.encoding['source']` in the subsequent dataset. Can simulate this 'issue' using local data: > import xarray as xr > file = '/path/to/file.nc' > fid = open(file, 'rb') > ds = xr.open_dataset( fid, engine='h5netcdf' ) This will have no source encoding in the dataset, but it could be grabbed from `fid.name`. Could a check be added for file-like objects, and then insert the `.path` or `.name` attribute into `.encoding['source']`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1358247997