Closed imjoseangel closed 3 years ago
This will fix also the error:
Traceback (most recent call last):
File "/Users/imjoseangel/source/imjoseangel/kubediff/kubediff", line 98, in <module>
main()
File "/Users/imjoseangel/source/imjoseangel/kubediff/kubediff", line 92, in main
failed = check_files(options.args.paths, printer, config)
File "/Users/imjoseangel/Documents/source/imjoseangel/kubediff/kubedifflib/_diff.py", line 271, in check_files
printer.finish()
File "/Users/imjoseangel/Documents/source/imjoseangel/kubediff/kubedifflib/_diff.py", line 254, in finish
print(json.dumps(self.data, sort_keys=True, indent=2, separators=(',', ': ')))
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 234, in dumps
return cls(
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 325, in _iterencode_list
yield from chunks
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/Users/imjoseangel/.pyenv/versions/3.9.7/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable
During tests in #125 we have detected that the line
prints:
And not:
We need to solve it adding decode: