Edgewall Software

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12055 closed defect (fixed)

Notifications panel in preferences crashes

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.1.5
Component: notification Version:
Severity: critical Keywords: preferences
Cc: Branch:
Release Notes:

Fixed raising TypeError from parse_subscriber_config when an attribute is used in [notification-subscriptions].

API Changes:
Internal Changes:


I found a fatal error on notifications panel in preferences with Trac 1.1.5dev r14047.

Traceback (most recent call last):
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/web/main.py", line 571, in _dispatch_request
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/web/main.py", line 230, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/prefs/web_ui.py", line 98, in process_request
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/notification/prefs.py", line 88, in render_preference_panel
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/notification/api.py", line 346, in default_subscriptions
    for d in self.subscriber_defaults[klass]:
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/cache.py", line 73, in __get__
    return CacheManager(instance.env).get(id, self.retriever, instance)
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/cache.py", line 242, in get
    data = retriever(instance)
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/notification/api.py", line 343, in subscriber_defaults
    return parse_subscriber_config(rawsubscriptions)
  File "/home/jun66j5/src/tracdev/svn/trunk/trac/notification/api.py", line 177, in parse_subscriber_config
    if attribute not in known_attrs.keys or \
TypeError: argument of type 'builtin_function_or_method' is not iterable

[notification-subscriber] section is configured with the following:

always_email = AlwaysEmailSubscriber
always_email.format = text/html
always_notify_cc = CarbonCopySubscriber
always_notify_owner = TicketOwnerSubscriber

Ad hoc patch. We should add unit tests for parse_subscriber_config in trac.notification.api.

  • trac/notification/api.py

    174174            byname[name]['class'] = value.strip()
    175175        else:
    176176            attribute = parts[1]
    177             if attribute not in known_attrs.keys or \
     177            if attribute not in known_attrs or \
    178178                    isinstance(known_attrs[attribute], str):
    179179                byname[name][attribute] = value
    180180            elif isinstance(known_attrs[attribute], int):

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 8 years ago

Owner: set to Jun Omae
Status: newassigned

Proposed changes in jomae.git@t12055.

comment:2 by Jun Omae, 8 years ago

Resolution: fixed
Status: assignedclosed

Committed in [14054:14055].

comment:3 by Ryan J Ollos, 8 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.