Edgewall Software

Opened 15 years ago

Last modified 15 years ago

#8083 closed defect

Email notifications don't work with Python 2.6: "TypeError: character mapping must return integer, None or unicode"" — at Initial Version

Reported by: trac@… Owned by: Emmanuel Blot
Priority: high Milestone: 0.11.4
Component: notification Version: none
Severity: critical Keywords: python26
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.