You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
long since we both worked on this. I recently noticed a crash using brew-stew when it's going to build the report file.
On line 287 when it's filling dict with json.loads it just crashes:
the traceback:
Traceback (most recent call last):
File "./brew-stew", line 366, in <module>
main()
File "./brew-stew", line 362, in main
env.build_report()
File "./brew-stew", line 287, in build_report
santa_json = dict(json.loads(santa_out))
ValueError: dictionary update sequence element #0 has length 6; 2 is required
the affected lines:
# line 287-288:
santa_json = dict(json.loads(santa_out))
f['santa_info'].append(santa_json)
However, now quick caveman debugging here, just remove the dict(), then try again and now a report gets written to json file successfully again. Works nearly as before, at least the resulting json file looks like a valid mix of brew info --json=v1 --installed and santactl fileinfo output.
caveman test:
# line 287:
santa_json = json.loads(santa_out)
f['santa_info'].append(santa_json)
Funny thing is the original version worked so well under macOS 10.12.x . I have not (yet) tested brew-stew again in 10.12.6 Sierra.
I'm unsure why overloading the dict() suddenly become an issue under macOS 10.13.3 / 10.13.4 but has not hit us in 10.12.6.
Just in case dict() loading is not urgently required, I tested a write of santa_out directly i.e. f['santa_info'].append(santa_out) would work of course.
Any ideas ? What do you think ?
The text was updated successfully, but these errors were encountered:
I had missed this issue altogether and ran into this today, and quickly addressed it in 449b8d6.
Although if we actually have different output on 10.13 than 10.12 (and the JSON output difference isn't from a santa version upgrade like I had thought), then probably the better way would be to examine its content and determine whether it is an array or a dictionary, and just to the consistent thing across both OSes. I don't have a 10.12 VM handy here to test with at the moment.
Hey Tim,
long since we both worked on this. I recently noticed a crash using brew-stew when it's going to build the report file.
On line 287 when it's filling dict with
json.loads
it just crashes:the traceback:
the affected lines:
However, now quick caveman debugging here, just remove the
dict()
, then try again and now a report gets written to json file successfully again. Works nearly as before, at least the resulting json file looks like a valid mix ofbrew info --json=v1 --installed
andsantactl fileinfo
output.caveman test:
Funny thing is the original version worked so well under macOS 10.12.x . I have not (yet) tested brew-stew again in 10.12.6 Sierra.
I'm unsure why overloading the dict() suddenly become an issue under macOS 10.13.3 / 10.13.4 but has not hit us in 10.12.6.
Just in case dict() loading is not urgently required, I tested a write of
santa_out
directly i.e.f['santa_info'].append(santa_out)
would work of course.Any ideas ? What do you think ?
The text was updated successfully, but these errors were encountered: