We suggest you use json.dumps() if you are writing a dictionary to the output file, which resolves this issue.