Bug #293448 - Fix TypeError when sending mail with python3, triggered by this
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Nov 2009 04:04:37 +0000 (04:04 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Nov 2009 04:04:37 +0000 (04:04 -0000)
issue: http://bugs.python.org/issue6521. Thanks to Albert W. Hopkins
<marduk@python.net> for this patch. (trunk r14844)

svn path=/main/branches/2.1.7/; revision=14860

pym/portage/mail.py

index 42ed43b83a1500a5b585faf8d46795d1d618e88b..0cc25008570fc13433ff764f23dbf4dbbe9a40e3 100644 (file)
@@ -23,7 +23,9 @@ if sys.hexversion >= 0x3000000:
 
 if sys.hexversion >= 0x3000000:
        def TextMessage(_text):
-               return MIMEText(_text, _charset="UTF-8")
+               mimetext = MIMEText(_text)
+               mimetext.set_charset("UTF-8")
+               return mimetext
 else:
        TextMessage = MIMEText