On Jan 17, 2013, at 12:02 PM, Benny Malengier <email@example.com> wrote:
> I see in your commits.
> - key_file = open(filename, "w")
> + if sys.version_info < 3:
> + key_file = open(filename, "w")
> + else:
> + key_file = open(filename, "w", encoding="utf-8")
> For another project, I discovered that io.open in python 2.7 also has the encoding keyword. I don't know if there are not subtle differenbce between the two or not, but for that project, we could change those lines by
> key_file = io.open(filename, "w", encoding="utf-8")
> An advantage of this was also that in python 2 you then get nice UnicodeDecodeErrors, while just using open can give strange errors if you eg open a windows utf-16 file (which in that project happens if a windows users saves csv files)..
The change above is from r21147. You'll see in r21148 that I already did that.