Hello,

I'm wondering about the following behaviour of str() with strings 
containing non-ASCII characters:

str(u'foo') returns 'foo' as expected.

str('lää') returns 'lää' as expected.

str(u'lää') raises UnicodeEncodeError

Is this behaviour sane? Possibly, but not documented at all. Somehow 
you'd expect str() to never fail. I'm hesitating about sending a bug 
report about a third party application, which fails because it is 
relaying on this.

Cheers,
Juho Vuori
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to