Opened 5 years ago

Closed 6 weeks ago

Last modified 6 weeks ago

#9522 closed defect (fixed)

Announcer Plugin doesn't work

Reported by: devenpawar Owned by: hasienda
Priority: high Component: AnnouncerPlugin
Severity: major Keywords: compatibility
Cc: rjollos Trac Release: 0.11

Description (last modified by rjollos)


I have installed trac 0.11 on Debian Linux I have Installed the Announcer plugin but I am getting this error.

2011-11-04 04:43:28,223 Trac[loader] ERROR: Skipping "announcerplugin.formatters.ticket_email = announcerplugin.formatters.ticket_email": (can't import "cannot import name exception_to_unicode")
2011-11-04 04:45:54,298 Trac[email_distributor] ERROR: EmailDistributor is unable to continue without supporting formatters.
2011-11-04 04:45:54,298 Trac[email_distributor] ERROR: EmailDistributer No formats found for email ticket

Could you please help me on this...

Attachments (0)

Change History (9)

comment:1 Changed 5 years ago by hasienda

  • Cc rjollos added; anonymous removed
  • Keywords compatibility added

While the description could clearly profit from better formatting (help please! :-) I dived into the code a bit:

[7604] introduced this new feature (added to Trac core between and 0.11.3), so it clearly breaks full backwards-compatibility down to 0.11. If upgrading is not an option (as I guess from your reference to Debian GNU/Linux) this clearly needs a fix. I'd suggest degraded functionality as sufficient. If no-one else feels like copying the whole module from Trac core, this should fix the your error on module load:

from trac.util.text import wrap, to_unicode
    from trac.util.text import exception_to_unicode
except ImportError:
    def exception_to_unicode(e): 
        return '%s: %s' % (e.__class__.__name__, to_unicode(e))

This is simply the preliminary method used in Trac r7794. BTW, this is needed for both, 0.11.2dev and the trunk development branch.

Comments from my fellow devs? May I take this ticket and push the suggested change?

comment:2 Changed 5 years ago by osimons

It is not quite right - some error handlers may even pass traceback that you would need to handle (or explicitly ignore) - like [7604] does. So the old trac:changeset:7794 actually looks wrong to me...

I added similar compat code to RPC plugin a long time ago, see xmlrpcplugin/trunk/tracrpc/ (currently line 16-28). This is basically just a cut-and-paste from the current Trac 0.12/trunk implementation.

comment:3 Changed 5 years ago by hasienda

  • Owner changed from doki_pen to hasienda
  • Priority changed from highest to high
  • Status changed from new to assigned

Thank you very much for the instant reply. Maybe this explains as well, why the code got replaced minutes later with what we have now.

Ok, so we definitely need the full code copy for backwards-compatibility.

comment:4 Changed 5 years ago by hasienda

(In [10916]) AnnouncerPlugin: Provide supplemental code for compatibility with Trac 0.11, refs #9522.

exception_to_unicode is actually used since [7604], but this method has been introduced to Trac some time after 0.11 release during development for 0.11.3 . Now code from Trac core is replicated to restore backwards-compatibility with Trac from down to 0.11 .

comment:5 Changed 5 years ago by hasienda

(In [10919]) AnnouncerPlugin: Revert [9114] for breaking Trac 0.11 and 0.12 compatibility, refs #9522.

Actually ChoiceOption appeared even after Trac 0.12 release, so this would belong into a dedicated 0.13 branch, that we may have in the future.

I plan to rollback and convert any 0.12 stuff to regain backwards-compatibility with Trac down to 0.11, and move development to 0.13 instead. This involves mostly i18n stuff (could be done in a more compatible fashion too) and especially the db connection handling, that has seen may changes. It seems to have settled only lately in Trac 0.13dev .

comment:6 Changed 4 years ago by rjollos

  • Description modified (diff)

comment:7 Changed 7 weeks ago by rjollos

  • Owner hasienda deleted
  • Status changed from assigned to new

comment:8 Changed 6 weeks ago by rjollos

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

comment:9 Changed 6 weeks ago by rjollos

  • Owner set to hasienda

Add Comment

Modify Ticket

as closed The owner will remain hasienda.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.