Modify

Opened 13 years ago

Closed 13 years ago

#8610 closed defect (fixed)

[patch] 'UnicodeEncodeError' for non-english enviroments

Reported by: Steffen Hoffmann Owned by: Álvaro Iradier
Priority: normal Component: SearchAllPlugin
Severity: normal Keywords: unicode
Cc: Ryan J Ollos Trac Release: 0.12

Description

I've tested this plugin tonight and it seems to work quit well.

But there is at least one issue with Trac>=0.12 for non-English Trac environments, whenever non-ASCII chars are encountered in exceptions. The fix is trivial in this case:

searchall_build/tracsearchall/searchall.py  2011-03-16 00:22:23.000000000 +0100
@@ -17,6 +17,7 @@
 from trac.env import open_environment
 from trac.util import Markup
 from trac.util.datefmt import to_datetime
+from trac.util.text import to_unicode
 
 import re
 import posixpath
@@ -160,7 +161,7 @@
                     except Exception, ex:
                         results += [(req.href('search', **req.args), 
                             "<strong>ERROR</strong> in search filter <em>%s</em>" % filter,
-                            to_datetime(None), "none", "Exception: %s" % str(ex)),]
+                            to_datetime(None), "none", "Exception: %s" % to_unicode(ex)),]
             
             req.href = orig_href

}

Attachments (0)

Change History (6)

comment:1 Changed 13 years ago by Steffen Hoffmann

Type: enhancementdefect

Oh, this was certainly meant to become a bug report.

comment:2 Changed 13 years ago by Ryan J Ollos

Steffen, ping me again on this in two weeks if the author doesn't respond and I'll push it to the repository. I'm pretty sure that airadier isn't around anymore.

comment:3 in reply to:  2 Changed 13 years ago by Ryan J Ollos

Replying to rjollos:

I'm pretty sure that airadier isn't around anymore.

Most recent checkin by airadier is for the ParametrizedTemplatesPlugin in Nov 2010, so perhaps I'm wrong on that.

comment:4 Changed 13 years ago by Álvaro Iradier

Hi jrollos, I'm here around but I hardly can get time to fix the pending issues.

I would agree if you can push the changes, just mail otaku42 and comment about this (you can provide this ticket as a proof I agree).

Thanks.

comment:5 in reply to:  4 Changed 13 years ago by Steffen Hoffmann

Replying to airadier:

Hi jrollos, I'm here around but I hardly can get time to fix the pending issues.

I would agree if you can push the changes, just mail otaku42 and comment about this (you can provide this ticket as a proof I agree).

Thanks to both of you for taking care. As I added this plugin to the production plugin stack at work I'm very interested in fixes and improvements. As mentioned it #8611 I'm willing to cooperate as well, if you need a helping hand. Please read this ticket and any future one with this offer in mind.

comment:6 Changed 13 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(In [9966]) Support non-ascii characters to in exceptions. Thanks to hasienda for the patch. Fixes #8610.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Álvaro Iradier.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.