Skip to content

'json' command doesn't work with NSData objects #1

@snej

Description

@snej

I love the 'json' command, but most of the time I've got JSON stored in NSData objects, not NSStrings, and it barfs on those:

Traceback (most recent call last):
  File "/Users/snej/.lldb/MCSLLDBToolkit/mcslldb_helpers.py", line 61, in wrapper
    result = function(debugger, *args)
  File "/Users/snej/.lldb/MCSLLDBToolkit/mcslldb_commands.py", line 22, in json
    pretty_json_string = json_lib.dumps(json_lib.loads(json_string),
  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 365, 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 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions