Opened 16 years ago
Closed 16 years ago
#8083 closed defect (fixed)
Email notifications don't work with Python 2.6: "TypeError: character mapping must return integer, None or unicode""
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | high | Milestone: | 0.11.4 |
Component: | notification | Version: | none |
Severity: | critical | Keywords: | python26 |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
When email notification is attempted to be sent with Python 2.6 the following exception is generated:
2009-02-20 20:29:35,839 Trac[web_ui] ERROR: Failure sending notification on change to ticket #39: Traceback (most recent call last): File "/usr/lib64/python2.6/site-packages/trac/ticket/web_ui.py", line 1017, in _do_save tn.notify(ticket, newticket=False, modtime=now) File "/usr/lib64/python2.6/site-packages/trac/ticket/notification.py", line 151, in notify NotifyEmail.notify(self, ticket.id, subject) File "/usr/lib64/python2.6/site-packages/trac/notification.py", line 246, in notify Notify.notify(self, resid) File "/usr/lib64/python2.6/site-packages/trac/notification.py", line 134, in notify self.begin_send() File "/usr/lib64/python2.6/site-packages/trac/notification.py", line 328, in begin_send self.server.login(self.user_name, self.password) File "/usr/lib64/python2.6/smtplib.py", line 574, in login (code, resp) = self.docmd(encode_cram_md5(resp, user, password)) File "/usr/lib64/python2.6/smtplib.py", line 538, in encode_cram_md5 response = user + " " + hmac.HMAC(password, challenge).hexdigest() File "/usr/lib64/python2.6/hmac.py", line 72, in __init__ self.outer.update(key.translate(trans_5C)) TypeError: character mapping must return integer, None or unicode
This is related to bug in HMAC library: http://bugs.python.org/issue5285
But login and password should not be sent to HMAC as unicode strings anyway.
Attachments (0)
Change History (3)
follow-up: 2 comment:1 by , 16 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
comment:2 by , 16 years ago
Replying to rblank:
I'd like to look into that, Manu, I hope you don't mind.
Nope. Feel free to fix any ticket related to the notification as well. I'm sorry I have no time to work on Trac for now ;-(
comment:3 by , 16 years ago
Keywords: | python26 added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in [7915] by encoding user_name
and password
as utf-8
prior to passing them to server.login()
.
Thanks Victor for the precise bug report.
I'd like to look into that, Manu, I hope you don't mind.