prjemian / punx

Python Utilities for NeXus HDF5 files
https://prjemian.github.io/punx
5 stars 7 forks source link

h5structure: UnicodeDecodeError #37

Closed prjemian closed 8 years ago

prjemian commented 8 years ago
mintadmin@mintadmin-VirtualBox ~/test_data $ punx st file_1.nxs 
Traceback (most recent call last):
  File "/home/mintadmin/Apps/anaconda/bin/punx", line 11, in <module>
    sys.exit(main())
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/main.py", line 326, in main
    args.func(args)
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/main.py", line 129, in func_structure
    report = mc.report(show_attributes)
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 67, in report
    structure = self._renderGroup(f, txt, indentation = "")
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 118, in _renderGroup
    s += self._renderGroup(value, itemname, indentation+"  ")
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 118, in _renderGroup
    s += self._renderGroup(value, itemname, indentation+"  ")
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 118, in _renderGroup
    s += self._renderGroup(value, itemname, indentation+"  ")
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 106, in _renderGroup
    s += self._renderDataset(value, itemname, indentation+"  ")
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 163, in _renderDataset
    s += self._renderAttributes(dset, indentation)
  File "/home/mintadmin/Apps/anaconda/lib/python2.7/site-packages/punx/h5structure.py", line 127, in _renderAttributes
    s.append("%s  @%s = %s" % (indentation, name, str(value)))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 0: ordinal not in range(128)
prjemian commented 8 years ago

That file is in the NeXus exampledata repository: exampledata/Soleil/file_1.nxs