Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description Of Changes
Level2File._decode_msg3logs'Length of message 3 is %d instead of expected %d; ...'when it skips a legacy-format message 3, but only passes one argument. Formatting the record then fails withTypeError: not enough arguments for format string, so instead of the message,loggingprints a--- Logging error ---traceback to stderr (and any handler at INFO level sees a broken record). This happens when reading the existing test filesKVWX_20050626_221551.gzandKLTX20050329_100015.gzwith INFO logging enabled.The second argument is now the expected size (
self.msg_hdr_fmt.size + msg_fmt.size, matching the2 * msg_hdr.size_hwit is compared with), e.g.Length of message 3 is 1044 instead of expected 976; this is likely the legacy format. Skipping....Added
test_level2_legacy_msg3_log, which reads both files with INFO logging and checks the message formats. It fails onmainwith theTypeErrorand passes with the fix;tests/io/test_nexrad.pypasses (177 tests) andruff/flake8are clean on the changed files.Note: I found this with a static check (ruff PLE1206) and used Claude (an AI assistant) to help write the fix and test; I reviewed and ran them as described.
Checklist