Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6799 closed defect (fixed)

Change announcement fails for wiki pages with non-ascii names

Reported by: o.shirochenkov@… Owned by: hasienda
Priority: high Component: AnnouncerPlugin
Severity: major Keywords: unicode 0.12
Cc: hasienda Trac Release: 0.12

Description

AnnouncerPlugin (latest trunk 7719) fails while sending e-mail notification when the Wiki name is non-Ascii:

2010-03-12 20:42:02,560 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/announcer/api.py", line 382, in _real_send
    distributor.distribute(transport, packages[transport], evt)
  File "build/bdist.linux-i686/egg/announcer/distributors/mail.py", line 256, in distribute
    self._do_send(transport, event, k, v, fmtdict[k])
  File "build/bdist.linux-i686/egg/announcer/distributors/mail.py", line 380, in _do_send
    decorator.decorate_message(event, rootMessage, decorators)
  File "build/bdist.linux-i686/egg/announcer/email_decorators/wiki.py", line 67, in decorate_message
    return next_decorator(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/util/mail.py", line 46, in next_decorator
    return next.decorate_message(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/email_decorators/ticket.py", line 83, in decorate_message
    return next_decorator(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/util/mail.py", line 46, in next_decorator
    return next.decorate_message(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/email_decorators/ticket.py", line 71, in decorate_message
    return next_decorator(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/util/mail.py", line 46, in next_decorator
    return next.decorate_message(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/email_decorators/generic.py", line 137, in decorate_message
    return next_decorator(event, message, decorators)
  File "build/bdist.linux-i686/egg/announcer/util/mail.py", line 46, in next_decorator
    return next.decorate_message(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/email_decorators/generic.py", line 116, in decorate_message
    return next_decorator(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/util/mail.py", line 46, in next_decorator
    return next.decorate_message(event, message, decorates)
  File "build/bdist.linux-i686/egg/announcer/email_decorators/generic.py", line 64, in decorate_message
    uid = uid_encode(self.env.abs_href(), event.realm, event.target)
  File "build/bdist.linux-i686/egg/announcer/util/mail.py", line 73, in uid_encode
    return b32encode(uid)
  File "/usr/lib/python2.5/base64.py", line 152, in b32encode
    c1, c2, c3 = struct.unpack('!HHB', s[i*5:(i+1)*5])
  File "/usr/lib/python2.5/struct.py", line 87, in unpack
    return o.unpack(s)
error: unpack requires a string argument of length 5

Attachments (4)

trac.log (6.4 KB) - added by o.shirochenkov@… 4 years ago.
log trac 0.13dev-r9983 and AnnouncerPlugin r8340
trac.ini (5.9 KB) - added by o.shirochenkov@… 4 years ago.
my config trac 0.13dev-r9983
trac.2.log (6.2 KB) - added by o.shirochenkov@… 4 years ago.
log trac 0.13dev-r10103 and TracAnnouncer r8960
trac.3.log (6.2 KB) - added by o.shirochenkov@… 4 years ago.
log trac 0.13dev-r10103 and TracAnnouncer r8969

Download all attachments as: .zip

Change History (19)

comment:1 Changed 4 years ago by hasienda

  • Cc hasienda added
  • Keywords unicode 0.12 added
  • Summary changed from Does not work for wiki pages with non-Ascii names to Change announcement fails for wiki pages with non-Ascii names

Since 0.12 wasn't out at the time of your report, could you confirm that this still applies to Trac 0.12, please?

May I further ask for some more details about your test environment? With "Wiki name" you refer to the wiki page name, and you certainly expected a page content change announcement to happen here, right? It could help to tell us the relevant page name etc. as well. Thanks in advance.

comment:2 Changed 4 years ago by o.shirochenkov@…

Sorry, I can't check this with 0.12 because my installation of trac is bleeding-edge.
I'll attach my configuration file and the latest and full log.
The wiki page name is "ТестоваяСтраница".

About Trac

System Information

Trac0.13dev-r9983
Trac0.13dev-r9983
Babel1.0dev-r488
Docutils0.5
Genshi0.6
mod_python3.3.1
Pygments1.2.2
pysqlite2.4.1
Python2.5.2 (r252:60911, Jan 24 2010, 15:24:24) [GCC 4.3.2]
Python2.5.2 (r252:60911, Jan 24 2010, 15:24:24) [GCC 4.3.2]
pytz2008c
pytz2008c
setuptools0.6c11
setuptools0.6c11
SQLite3.5.9
Subversion1.5.1 (r32289)
jQuery:1.4.2

Installed Plugins

AnnouncerPlugin0.12-p2.dev/usr/lib/python2.5/site-packages/AnnouncerPlugin-0.12_p2.dev-py2.5.egg
TracFlashEmbedMacroN/A/usr/share/trac/projects/os/trac/plugins/TracFlashEmbedMacro.pyc
UserStatsRev/usr/share/trac/projects/os/trac/plugins/UserStats.pyc

Changed 4 years ago by o.shirochenkov@…

log trac 0.13dev-r9983 and AnnouncerPlugin r8340

Changed 4 years ago by o.shirochenkov@…

my config trac 0.13dev-r9983

comment:3 Changed 4 years ago by o.shirochenkov@…

Sorry, AnnouncerPlugin revision is r8336:
Path: announcer
URL: http://trac-hacks.org/svn/announcerplugin/trunk
Repository Root: http://trac-hacks.org/svn
Repository UUID: 7322e99d-02ea-0310-aa39-e9a107903beb
Revision: 8340
Node Kind: directory
Schedule: normal
Last Changed Author: hasienda
Last Changed Rev: 8336
Last Changed Date: 2010-08-05 16:05:49 +0400

comment:4 Changed 4 years ago by hasienda

  • Owner changed from doki_pen to hasienda
  • Status changed from new to assigned
  • Summary changed from Change announcement fails for wiki pages with non-Ascii names to Change announcement fails for wiki pages with non-ascii names

ТестоваяСтраница - nice (I remember a little from the 5 years of Russian lessons at school.)
Thanks for the requested information. Now there is definitely something to start working on.

I'll try to find a solution. I suspect it might be related to (missing) unicode string encoding, and if so, this could be fixed easily. I hope so, let's do some debugging here and see.

comment:5 Changed 4 years ago by hasienda

BTW, this is somewhat related to #6443.

comment:6 Changed 4 years ago by doki_pen

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

(In [8960]) Handle utf8 in subjects

Fixes #6799

comment:7 Changed 4 years ago by anonymous

svn info
Path: .
URL: http://trac-hacks.org/svn/announcerplugin/trunk
Repository Root: http://trac-hacks.org/svn
Repository UUID: 7322e99d-02ea-0310-aa39-e9a107903beb
Revision: 8968
Node Kind: directory
Schedule: normal
Last Changed Author: doki_pen
Last Changed Rev: 8960
Last Changed Date: 2010-09-18 21:24:17 +0400 (Сбт, 18 Сен 2010)

Trac 0.13dev-r10103

TracAnnouncer 0.12.1.dev /usr/lib/python2.5/site-packages/TracAnnouncer-0.12.1.dev-py2.5.egg

Please tell me, is it just me or something is wrong?
I'll attach a log.

Changed 4 years ago by o.shirochenkov@…

log trac 0.13dev-r10103 and TracAnnouncer r8960

comment:8 Changed 4 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

Ah. for me exception is gone, and email is sent, but title is blank. I'll look at it more. It's better ;)

comment:9 Changed 4 years ago by doki_pen

try it now

comment:10 Changed 4 years ago by o.shirochenkov@…

r8969 doesn't work for me

Changed 4 years ago by o.shirochenkov@…

log trac 0.13dev-r10103 and TracAnnouncer r8969

comment:11 Changed 4 years ago by doki_pen

I can see the issue now. I add a reversible message id to the email so that trac can handle responses to emails. (this requires other tools as well, if interested, check out tracgate at http://github.com/dokipen). The trick to this message id is that, on a response email, I must be able to decode it to an actual resource so the response email can perform some action on the resource. This is only used for realms specified in

[announcer]
email_threaded_realms = wiki, ticket

As a workaround, you can change this to tickets. For tickets, the ticket id is used so you wont see this issue. Unfortunately, wiki name is the id for wiki pages. I'll get this fixed though.

comment:12 Changed 4 years ago by doki_pen

So this is workaround:

[announcer]
email_threaded_realms = ticket

comment:13 Changed 4 years ago by o.shirochenkov@…

Our group don't really need "reply" feature, so this workaround fits us.
I have changed my config and it works with non-ascii-named wiki pages.
I can't even test tracgate feature at this time, so I don't know how can I help you to test further fixes for this ticket.

comment:14 Changed 4 years ago by o.shirochenkov@…

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

Thank you, r8976 solved this issue!

comment:15 Changed 4 years ago by doki_pen

I should also mention that using the work around would stop your email client from being able to thread announcements about the same wiki page. I had forgotten this detail. But the workaround shouldn't be needed anymore.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from hasienda. Next status will be '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.