Problems with email.Generator.Generator

Chris Withers chris at
Mon Sep 11 21:29:28 CEST 2006

Peter Otten wrote:
> What past experience?
>>>> StringIO.StringIO().write(unichr(128))
>>>> cStringIO.StringIO().write(unichr(128))
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\x80' in position
> 0: ordinal not in range(128)

OK, I stand corrected, although I suspect the bug is actually in 
StringIO.StringIO in that it doesn't barf on unicodes.

(Python 3000 and all that)

Which again leads us back to the email package: it used to do the right 
thing from what I can see, and now it doesn't, and ends up trying to 
write a unicode to a cStringIO, which (rightly, I guess) barfs...

Barry, Barry, where are you? ;-)


Simplistix - Content Management, Zope & Python Consulting

More information about the Python-list mailing list