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/issues/681#issuecomment-226238810,https://api.github.com/repos/pydata/xarray/issues/681,226238810,MDEyOklzc3VlQ29tbWVudDIyNjIzODgxMA==,1217238,2016-06-15T16:15:05Z,2016-06-15T16:15:05Z,MEMBER,"@byersiiasa What version of netCDF4-Python are you using? This was fixed in netCDF4-Python v1.2.3. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,122776511 https://github.com/pydata/xarray/issues/681#issuecomment-190921447,https://api.github.com/repos/pydata/xarray/issues/681,190921447,MDEyOklzc3VlQ29tbWVudDE5MDkyMTQ0Nw==,1217238,2016-03-01T21:49:36Z,2016-03-01T21:49:36Z,MEMBER,"This has been fixed upstream: https://github.com/Unidata/netcdf4-python/pull/533 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,122776511 https://github.com/pydata/xarray/issues/681#issuecomment-165547726,https://api.github.com/repos/pydata/xarray/issues/681,165547726,MDEyOklzc3VlQ29tbWVudDE2NTU0NzcyNg==,1217238,2015-12-17T18:57:04Z,2015-12-17T18:57:04Z,MEMBER,"Yes, I would support this change. On Thu, Dec 17, 2015 at 10:43 AM, Joe Hamman notifications@github.com wrote: > So an alternative choice would be to attempt to always encode unicode (str > on Python 3) attributes as ASCII when saving with netCDF4, e.g., > > Exactly what I have done in the past. > > Does this seem like something we should change/fix? > > — > Reply to this email directly or view it on GitHub > https://github.com/xray/xray/issues/681#issuecomment-165543980. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,122776511 https://github.com/pydata/xarray/issues/681#issuecomment-165543980,https://api.github.com/repos/pydata/xarray/issues/681,165543980,MDEyOklzc3VlQ29tbWVudDE2NTU0Mzk4MA==,2443309,2015-12-17T18:42:36Z,2015-12-17T18:42:36Z,MEMBER,"> So an alternative choice would be to attempt to always encode unicode (str on Python 3) attributes as ASCII when saving with netCDF4, e.g., Exactly what I have done in the past. Does this seem like something we should change/fix? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,122776511 https://github.com/pydata/xarray/issues/681#issuecomment-165540231,https://api.github.com/repos/pydata/xarray/issues/681,165540231,MDEyOklzc3VlQ29tbWVudDE2NTU0MDIzMQ==,1217238,2015-12-17T18:31:08Z,2015-12-17T18:31:08Z,MEMBER,"Yes, this is probably related to the netCDF4-python change discussed here: https://github.com/Unidata/netcdf4-python/issues/388 Unfortunately, lots of older netCDF programs don't know how to interpret the netCDF4 ""string"" dtype -- and to be honest, even the netCDF-C library doesn't always properly save such data as Unicode yet, though that should be fixed in the next release (4.4.0 -- see https://github.com/Unidata/netcdf-c/issues/127 for more details). So an alternative choice would be to attempt to always encode unicode (str on Python 3) attributes as ASCII when saving with netCDF4, e.g., ``` python def maybe_encode(string, encoding='ascii'): try: return string.encode(encoding) except UnicodeEncodeError: return string ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,122776511