timsutton / brew-stew Goto Github PK
View Code? Open in Web Editor NEWMonolithic homebrew packages for dev environment deployment
Monolithic homebrew packages for dev environment deployment
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:
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 ?
Currently it's easy to get this to happen when adding santa output to the report:
Traceback (most recent call last):
File "./build.py", line 248, in <module>
main()
File "./build.py", line 244, in main
env.build_report()
File "./build.py", line 228, in build_report
santa_json = dict(json.loads(santa_out))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.