Closed Daruko0 closed 6 years ago
Thanks for your pull request! I've tested your solution and unfortunately it doesn't work on Python 2 since it doesn't support the encoding
argument in the open function.
To support both Python 2 and 3, maybe you could try dropping the encoding
argument, and write the changes to the file as follows: print(json.dumps(comment, ensure_ascii=False).encode('utf8'), file=fp)
.
I took the liberty of importing the io module and changing open
to io.open
, which are exactly the same thing in python 3. That seems to have solved the python 2 compatibility. What do you think about this?
Great, that works too. Thanks again!
Small tweek to add UTF-8 support