'Can't read SEISAN Nordic format sfiles with Obspy

I've been trying to read a SEISAN file with obspy (the documentation says it is a supported format for the read function), but everytime i get this error

  File "/Users/myname/virtualenv/lib/python3.9/site-packages/obspy/core/util/base.py", line 402, in _read_from_plugin
    raise TypeError('Unknown format for file %s' % filename)
TypeError: Unknown format for file /Users/lorettedrique/Stage_dgf/REA/01-0502-03L.S202010

Then when I try with _read_seisan (from the obspy.io.seisan package), i get this :

  File "/Users/myname/virtualenv/lib/python3.9/site-packages/obspy/io/seisan/core.py", line 136, in _read_seisan
    (byteorder, arch, version) = _get_version(data)
TypeError: cannot unpack non-iterable NoneType object

I tried parsing it with a parser routine i found, but it's no good, and I would like to resolve this issue with SEISAN because it's basically all I use.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source