Giter Site home page Giter Site logo

brew-stew's People

Contributors

headmin avatar timsutton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

brew-stew's Issues

crash with build_report

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 ?

Add error handling for `santactl` reporting

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.