semuconsulting / pynmeagps

Python library for parsing and generating NMEA 0183 GNSS/GPS protocol messages.
BSD 3-Clause "New" or "Revised" License
81 stars 28 forks source link

NMEAReader.parse doesn't ignore invalid messages when validate's VALMSGID bit is not set. #25

Closed nmichaels-qualinx closed 1 year ago

nmichaels-qualinx commented 1 year ago

The title says it all. This docstring:

:param int validate (kwarg): bitfield validation flags - VALCKSUM (default), VALMSGID and :return: NMEAMessage object (or None if unknown message and VALMSGID is not set)

is a lie. When I pass validate=0 to the parse method or to the NMEAReader constructor, it still raises an NMEAParseError when it's fed a line that isn't valid NMEA. I would expect an NMEAReader instance to just skip over the invalid line, and NMEAReader.parse() to return None, as specified in the docstring.

nmichaels-qualinx commented 1 year ago

Checked the release against my test data, and it worked perfectly. Thanks for fixing this so quickly.

semuadmin commented 1 year ago

Checked the release against my test data, and it worked perfectly. Thanks for fixing this so quickly.

Used to work fine but regressed somewhere along the way. I've added a check to the automated test suite so it shouldn't happen again.