Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 222633 Details for
Bug 291331
sys-apps/portage with USE=python3 cause error UnicodeEncodeError in smtplib.sendmail
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
force ascii in order to avoid UnicodeEncodeError
force_ascii.patch (text/plain), 1.21 KB, created by
Zac Medico
on 2010-03-08 08:40:48 UTC
(
hide
)
Description:
force ascii in order to avoid UnicodeEncodeError
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2010-03-08 08:40:48 UTC
Size:
1.21 KB
patch
obsolete
>Index: pym/portage/mail.py >=================================================================== >--- pym/portage/mail.py (revision 15758) >+++ pym/portage/mail.py (revision 15759) >@@ -14,7 +14,7 @@ > > from portage import os > from portage import _encodings >-from portage import _unicode_encode >+from portage import _unicode_decode, _unicode_encode > from portage.localization import _ > import portage > >@@ -135,7 +135,17 @@ > myconn = smtplib.SMTP(mymailhost, mymailport) > if mymailuser != "" and mymailpasswd != "": > myconn.login(mymailuser, mymailpasswd) >- myconn.sendmail(myfrom, myrecipient, message.as_string()) >+ >+ message_str = message.as_string() >+ if sys.hexversion >= 0x3000000: >+ # Force ascii encoding in order to avoid UnicodeEncodeError >+ # from smtplib.sendmail with python3 (bug #291331). >+ message_str = _unicode_encode(message_str, >+ encoding='ascii', errors='backslashreplace') >+ message_str = _unicode_decode(message_str, >+ encoding='ascii', errors='replace') >+ >+ myconn.sendmail(myfrom, myrecipient, message_str) > myconn.quit() > except smtplib.SMTPException as e: > raise portage.exception.PortageException(_("!!! An error occured while trying to send logmail:\n")+str(e))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 291331
:
209276
| 222633