Modify

Opened 3 years ago

Last modified 23 months ago

#9522 assigned defect

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)

Hi,

I have installed trac 0.11 on Debian Linux 2.6.32.8.
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 (6)

comment:1 Changed 3 years ago by hasienda

  • Cc rjollos added
  • 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 0.11.2.1 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
try:
    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 3 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/util.py (currently line 16-28). This is basically just a cut-and-paste from the current Trac 0.12/trunk implementation.

comment:3 Changed 3 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 3 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 0.11.2.1 down to 0.11 .

comment:5 Changed 3 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 23 months ago by rjollos

  • Description modified (diff)

Add Comment

Modify Ticket

Action
as assigned .
Author


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

 
Note: See TracTickets for help on using tickets.