Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceback Output #25

Open
inigma117 opened this issue Mar 3, 2016 · 0 comments
Open

Traceback Output #25

inigma117 opened this issue Mar 3, 2016 · 0 comments

Comments

@inigma117
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant