Modify

Opened 6 years ago

Closed 6 years ago

#4163 closed defect (fixed)

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

Reported by: avanpernis Owned by: slestak
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 avanpernis 6 years ago.
Patch to resolve #4163

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by avanpernis

Patch to resolve #4163

comment:1 Changed 6 years ago by avanpernis

  • Trac Release changed from 0.10 to 0.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 6 years ago by doki_pen

  • Owner changed from doki_pen to slestak

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

comment:3 Changed 6 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

r4904 in trunk

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.