Skip to content

Traceback Output #25

Description

@inigma117

When parseing PDF's I keep getting this traceback error message:

Traceback (most recent call last):
File "/Users/user/Documents/ioc_parser/iocp.py", line 311, in
parser.parse(args.PATH)
File "/Users/user/Documents/ioc_parser/iocp.py", line 298, in parse
self.handler.print_error(path, e)
File "/Users/user/Documents/ioc_parser/output.py", line 62, in print_error
print(json.dumps(data))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: TypeError("PDFSyntaxError('No /Root object! - Is this really a PDF?',) is not JSON serializable",) is not JSON serializable

Is it possible to have this changed to output the file it is attempting to parse at this time?

I have this loaded into a shell script and running on an entire directory. I think it would be valuable to know what file is causing this issue so I can investigate and fix. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions