Handle unicode while writing to file (Fixes #169)

This commit is contained in:
Somdev Sangwan
2018-12-17 16:44:17 +05:30
committed by GitHub
parent b781ad5c8f
commit 2e8d83a4db

View File

@@ -200,7 +200,7 @@ def writer(obj, path):
elif kind == 'dict':
obj = json.dumps(obj, indent=4)
savefile = open(path, 'w+')
savefile.write(obj)
savefile.write(obj.encode('utf-8'))
savefile.close()