Message214223
re: file. You forgot the 'u' in front of the string:
>>> f.write(u'This is a «test»\n')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xab' in position 10: ordinal not in range(128)
So you were actually writing binary in your console encoding, which must have been utf-8. (This kind of confusion is the main reason python3 exists). |
|
Date |
User |
Action |
Args |
2014-03-20 13:12:04 | r.david.murray | set | recipients:
+ r.david.murray, georg.brandl, docs@python, Daniel.U..Thibault |
2014-03-20 13:12:04 | r.david.murray | set | messageid: <1395321124.62.0.288878671484.issue20686@psf.upfronthosting.co.za> |
2014-03-20 13:12:04 | r.david.murray | link | issue20686 messages |
2014-03-20 13:12:04 | r.david.murray | create | |
|