Skip to content
Snippets Groups Projects
  • Erin (Josh) Rigler's avatar
    a3e3c12d
    Handle empty buffer returned from Edge · a3e3c12d
    Erin (Josh) Rigler authored
    ObsPy's waveserver.py (and associated methods) do not handle an empty
    buffer returned from Edge's earthworm server. In short, they generate
    a None value instead of an empty byte string as one might expect (and
    they clearly did expect, since they attempted `len(dat)` where dat
    was expected to be a byte string, but was a None object if/when Edge
    had no data. This fix employs a try/except clause to generate an
    empty string if the waveserver client fails with a TypeError, as is
    the case when Edge returns an empty buffer.
    a3e3c12d
    History
    Handle empty buffer returned from Edge
    Erin (Josh) Rigler authored
    ObsPy's waveserver.py (and associated methods) do not handle an empty
    buffer returned from Edge's earthworm server. In short, they generate
    a None value instead of an empty byte string as one might expect (and
    they clearly did expect, since they attempted `len(dat)` where dat
    was expected to be a byte string, but was a None object if/when Edge
    had no data. This fix employs a try/except clause to generate an
    empty string if the waveserver client fails with a TypeError, as is
    the case when Edge returns an empty buffer.