rtldavis extension python version change ripple

32 views
Skip to first unread message

vince

unread,
Nov 19, 2025, 2:49:26 PM (8 days ago) Nov 19
to weewx-user
If anybody is intending to use my script (link) to install the rtldavis driver over a current version of the raspi using debian trixie as the base, you will see Syntax Warning(s) during installation of the extension.

This seems to be due to the newer version of python in trixie.  See (stackoverflow) for the gory details.

The last answer in that thread shows how to deal with it if you're so inclined, given that a future python will someday break rather than throw a warning. In short, patch the offending lines in rtldavis.py slightly.

The warnings indicate which line items to patch.  Basically change re.compile( to re.compile(r on the offending lines.  Regular expressions and particularly python's implementation of them make my head spin, so I can't speak re: whether this actually changes behavior other than stopping the python interpreter from barking at you.

The offending warnings are below just as a FYI...

/home/pi/weewx-data/bin/user/rtldavis.py:513: SyntaxWarning: invalid escape sequence '\d'
  IDENTIFIER = re.compile("^\d\d:\d\d:\d\d.[\d]{6} [0-9A-F][0-7][0-9A-F]{14}")
/home/pi/weewx-data/bin/user/rtldavis.py:514: SyntaxWarning: invalid escape sequence '\d'
  PATTERN = re.compile('([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2}) ([\d]+) ([\d]+) ([\d]+) ([\d]+)')
/home/pi/weewx-data/bin/user/rtldavis.py:543: SyntaxWarning: invalid escape sequence '\d'
  PATTERNv13 = re.compile('ChannelIdx:([\d]+) ChannelFreq:([\d]+) FreqError:([\d-]+) Transmitter:([\d]+)')
/home/pi/weewx-data/bin/user/rtldavis.py:544: SyntaxWarning: invalid escape sequence '\d'
  PATTERNv12 = re.compile('ChannelIdx:([\d]+) ChannelFreq:([\d]+) FreqError:([\d-]+)')



Reply all
Reply to author
Forward
0 new messages