commit | 101bc4e2b8c9b99d9565e75b8815e98852100968 | [log] [tgz] |
---|---|---|
author | Nicolas PLANEL <nplanel@gmail.com> | Sat Oct 03 14:59:51 2015 +1000 |
committer | Nicolas PLANEL <nplanel@gmail.com> | Sat Oct 03 15:05:32 2015 +1000 |
tree | 7c52c097fa34af93ee148c1ca5048fd422d040c6 | |
parent | bcf33a58f1f7f5a61bb65bcd6fe6ad8489d75169 [diff] |
file.write() need bytes when file is opened in binary mode Avoid "TypeError: a bytes-like object is required, not 'str'" error during write(). As the outfile need to be opened in binary mode, so python 3 require bytes stream as argument in outfile.write(). Fixed by set all output string write to utf-8 encoding. Signed-off-by: Nicolas PLANEL <nplanel@gmail.com>