This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Daniel.U..Thibault, docs@python, georg.brandl, r.david.murray
Date 2014-03-20.13:12:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395321124.62.0.288878671484.issue20686@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2014-03-20 13:12:04r.david.murraysetrecipients: + r.david.murray, georg.brandl, docs@python, Daniel.U..Thibault
2014-03-20 13:12:04r.david.murraysetmessageid: <1395321124.62.0.288878671484.issue20686@psf.upfronthosting.co.za>
2014-03-20 13:12:04r.david.murraylinkissue20686 messages
2014-03-20 13:12:04r.david.murraycreate