evidens/json2csv

Basic conversion has broken

ananpadm opened this issue · 2 comments

I'm getting below error with basic run. unicode has been installed. I do not have any workaround and blocked

python json2csv.py /root/dbseries.json /root/dbseries.csv
File "json2csv.py", line 82
for k, val in row.items()})
^
SyntaxError: invalid syntax

If i run the same json file against https://json-csv.com/api i'm getting a proper csv

Which version of python are you using? dict comprehensions are only supported as of 2.7.

Try running the script without the --strings argument. That should still work. If that's the issue it's fairly easy to convert it back to a list comprehension and cast that to a dict instead.

My bad, I'm on centos and have not upgraded python from 2.6.6 since it will break yum.

I had another virtualenv with 2.7 and code works fine. Not an issue. Closing