File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,10 @@ def attrs_to_dict(obj, section):
185185 sectionlength = len (section )
186186 for key in list (obj .attrs ):
187187 if key [:sectionlength ] == section :
188- result [key [sectionlength :]] = obj .attrs .pop (key )
188+ val = obj .attrs .pop (key )
189+ if isinstance (val , bytes ):
190+ val = val .decode ()
191+ result [key [sectionlength :]] = val
189192 return result
190193
191194 def attrs_remove_section (obj , section ):
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def _separate_metadata(ds):
6969
7070 # Save metadata as a dictionary
7171 metadata_vals = [ds [var ].values .item () for var in scalar_vars ]
72+ metadata_vals = [x .decode () if isinstance (x , bytes ) else x for x in metadata_vals ]
7273 metadata = dict (zip (scalar_vars , metadata_vals ))
7374
7475 # Add default values for dimensions to metadata. These may be modified later by
You can’t perform that action at this time.
0 commit comments