Modify

Opened 16 years ago

Closed 16 years ago

#4163 closed defect (fixed)

Error sending e-mails when field value is "None"

Reported by: Andrew Van Pernis Owned by: Steve Romanow
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I've been running the Slestak branch with Trac 11.2.1

System Information
Trac: 	        0.11.2.1
Python: 	2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
setuptools: 	0.7a1
SQLite: 	3.3.4
pysqlite: 	2.3.2
Genshi: 	0.5
mod_python: 	3.3.1
Pygments: 	0.10
Subversion: 	1.5.1 (r32289)
jQuery:	        1.2.6

Many e-mails were not being sent so checking the log I noticed the following error.

2008-11-25 10:29:39,342 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
  File "build\bdist.win32\egg\announcerplugin\api.py", line 377, in _real_send
    distributor.distribute(transport, packages[transport], evt)
  File "build\bdist.win32\egg\announcerplugin\distributors\email_distributor.py", line 195, in distribute
    self._do_send(transport, event, format, messages[format], formats[format], None, to, public_cc)
  File "build\bdist.win32\egg\announcerplugin\distributors\email_distributor.py", line 224, in _do_send
    output = formatter.format(transport, event.realm, format, event)
  File "build\bdist.win32\egg\announcerplugin\formatters\ticket_email.py", line 88, in format
    return self._format_html(event)
  File "build\bdist.win32\egg\announcerplugin\formatters\ticket_email.py", line 154, in _format_html
    if ('\n' in new_value) or ('\n' in old_value):
TypeError: argument of type 'NoneType' is not iterable

Attachments (1)

ticket_email.py.diff (1.5 KB) - added by Andrew Van Pernis 16 years ago.
Patch to resolve #4163

Download all attachments as: .zip

Change History (4)

Changed 16 years ago by Andrew Van Pernis

Attachment: ticket_email.py.diff added

Patch to resolve #4163

comment:1 Changed 16 years ago by Andrew Van Pernis

Trac Release: 0.100.11

I've added a patch that worked for me. I'm not a python expert, so I did the simple solution of converting everything to strings.

comment:2 Changed 16 years ago by Robert Corsaro

Owner: changed from Robert Corsaro to Steve Romanow

I've noticed casting with str() doesn't work for non-ascii characters. Perhaps casting with unicode() is a better idea.

comment:3 Changed 16 years ago by anonymous

Resolution: fixed
Status: newclosed

r4904 in trunk

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steve Romanow.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.