-
-
Notifications
You must be signed in to change notification settings - Fork 263
lm_sensors: update broken json parser #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Gonna be a few days before I can test this, I'm afraid. The system on which this is a problem is currently undergoing maintenance. |
Can confirm this works, although with this splitting, my case never hits the codepath with JSONDecodeErrors. So I can't testify to the effectiveness / robustness of building the chunk across multiple lines. |
@MacGyverNL Can you test this again? The first commit was simple, but will fail on several lines (repeatedly) until we get a valid JSON (again, repeatedly). I took second look at this and wondered if we can make do with this (second commit) instead. |
e637990
to
ca92fd4
Compare
Your most recent version does not chunk, I think you mishandled the caret and dollar placement. I don't know what your goal was with those, but if I fix those naively ( |
ca92fd4
to
ecfe23e
Compare
Noted! It's a better solution. Please try it again. |
b22b0ae
to
773b9ff
Compare
Yeah this should work (edit for clarity: the commit I tested, 773b9ff, doesn't), once you get the (I know I could commit this but I don't currently have a fork, I'm just manual-editing the python code of my system package, and it's a single line.) |
773b9ff
to
5a401fb
Compare
Thank you for your help / looking into this. We should be good here now. |
5a401fb
to
93b3b7e
Compare
93b3b7e
to
a82cc6b
Compare
@ultrabug \o/ |
This changes how we parse broken json blocks from upstream. Instead of splitting chunks based on
}\n{
, this just run every line until we get a valid json chunk before we add it to a dictionary.Ought to address #2226 (comment). /cc @MacGyverNL for testing.