Ticket #4875 (closed defect: wontfix)
Unicode error in notification
| Reported by: | luis@… | Owned by: | eblot |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | notification | Version: | 0.10.3 |
| Severity: | major | Keywords: | |
| Cc: | blackhex@… |
Description
This backtrace refers to a module (Discussion) but the same happens with the ticket system... Basically, anything that uses the notification API.
When sending email with accented chars (á, for example) in the subject , this exception is raised. On the file notification.py, inside the function format_header(key, value), the Exception raised is "UnicodeDecodeError", but the code expects "UnicodeEncodeError"... Just switching the name of the expected exception solves the problem.
File "/usr/local//lib/python2.3/site-packages/trac/web/main.py", line 387, in dispatch_request
dispatcher.dispatch(req)
File "/usr/local//lib/python2.3/site-packages/trac/web/main.py", line 237, in dispatch
resp = chosen_handler.process_request(req)
File "build/bdist.linux-i686/egg/tracdiscussion/core.py", line 72, in process_request
File "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 33, in render_discussion
File "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 597, in _do_action
File "build/bdist.linux-i686/egg/tracdiscussion/notification.py", line 91, in notify
File "/usr/local//lib/python2.3/site-packages/trac/notification.py", line 216, in notify
Notify.notify(self, resid)
File "/usr/local//lib/python2.3/site-packages/trac/notification.py", line 115, in notify
self.send(torcpts, ccrcpts)
File "build/bdist.linux-i686/egg/tracdiscussion/notification.py", line 130, in send
File "/usr/local//lib/python2.3/site-packages/trac/notification.py", line 360, in send
self.add_headers(msg, headers);
File "/usr/local//lib/python2.3/site-packages/trac/notification.py", line 236, in add_headers
msg[h] = self.encode_header(h, headers[h])
File "/usr/local//lib/python2.3/site-packages/trac/notification.py", line 275, in encode_header
return self.format_header(key, value)
File "/usr/local//lib/python2.3/site-packages/trac/notification.py", line 225, in format_header
tmp = name.encode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 43: ordinal not in range(128)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


