From 778ae021b57cc7aa3cc804bebf52fa3f1283c309 Mon Sep 17 00:00:00 2001 From: chad-earthscope Date: Thu, 13 Jun 2024 20:22:32 -0700 Subject: [PATCH] Fix retention of sequence number logic to handle no record pointer --- src/mseedlib/msrecord.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mseedlib/msrecord.py b/src/mseedlib/msrecord.py index 256eb9a..ba44ecb 100644 --- a/src/mseedlib/msrecord.py +++ b/src/mseedlib/msrecord.py @@ -436,7 +436,8 @@ def pack(self, handler, handlerdata=None, datasamples=None, sampletype=None, self._samplecnt = len_datasamples # Retain miniSEED "sequence number" if parsed record is v2 - if self.formatversion == 2 and self._record is not None: + if self.formatversion == 2 and self._record: + # Extract sequence number from record, first 6 bytes are ASCII digits sequence_string = self._record[0:6].decode('utf-8') sequence_number = int(sequence_string)