Errorcode führte zu Programmexit:
> 12.10.2025 02:20:39,918 - inputThread sdrInput _runThread [ERROR] error in sdr input routine
Traceback (most recent call last):
> File "/opt/boswatch3/boswatch/inputSource/sdrInput.py", line 65, in _runThread
> self.addToQueue(line)
> ...
> ValueError: invalid literal for int() with base 10: ' '
Ursache:
Die Funktion `_getBitrateRicSubric()` in `pocsagDecoder.py` griff fest auf `data[40]` zu, um den SubRIC-Wert zu ermitteln. Bei Fehlerhaften Datensätzen von multimon-ng kann sich die Position jedoch verschieben, wodurch an dieser Stelle ein Leerzeichen (' ') statt einer Ziffer stand. Dies führte zu einem ValueError und damit zum Abbruch des gesamten SDR-Threads.
Änderung:
Die Funktion wurde auf robuste Regex-Analyse umgestellt (analog fmsDecoder.py und pocsagDecoder.py):
- Bitrate, Address (RIC) und Function (SubRIC) werden nun mit regulären Ausdrücken extrahiert.
- Die ursprüngliche Logik (`subric = int(Function) + 1`) bleibt vollständig erhalten.
- Enthält die Zeile keine gültige Function, wird eine Warnung geloggt ("Invalid POCSAG function (not 0–3)")
- Zusätzliche Fehlerabsicherung durch try/except.
Ergebnis:
Der Decoder ist nun tolerant gegenüber Formatabweichungen und verhindert Abstürze bei fehlerhaften oder unvollständigen multimon-ng-Zeilen.
Without this change, many warnings like this will be generated while running pytest:
```
test/test_template.py:3
/build/source/test/test_template.py:3: DeprecationWarning: invalid escape sequence '\/'
"""!
```
This can also be seen when manually running python with warnings enabled.
This happens because the comment uses a multiline string and Python interprets the backslash in the logo as an escape character and complains that \/ is not a valid escape sequence. To fix this, prepend the string with the letter r to indicate that the backslash should be treated as a literal character, see https://docs.python.org/3/reference/lexical_analysis.html#index-20.
I also applied this change to all the comment strings since that shouldn't break anything and to establish it as a pattern for the future so this problem hopefully never happens again.
This is what I did specifically:
- Change the comment at the top of bw_client.py and bw_server.py to start with `"""!` since that seems to be the pattern here
- Search-and-Replace all occurances of `"""!` with `r"""!`
- Manually change the strings in `logoToLog()` in boswatch/utils/header.py